Scan HTML for values with a special character before them.

Posted by DogPooOnYourShoe on Stack Overflow See other posts from Stack Overflow or by DogPooOnYourShoe
Published on 2010-12-31T10:44:20Z Indexed on 2010/12/31 11:54 UTC
Read the original article Hit count: 136

Filed under:
|

Say I have values on my page, like #100 #246, What I want to do is scan the page for values with a # before them and then alter them to put a hyperlink on it

$MooringNumbers = '#!' . $MooringNumbers . ' | ' . '#!' . $row1["Number"];
  }  
    $viewedResult =  '<tr><td>' .$Surname.'</td><td>'.$Title.'</td><td>'.$MooringNumbers . '</td><td>'.$Telephone.'</td><td>' . '<a href="rlayCustomerUpdtForm.php?id='.$id.'">[EDIT]</a></td>'.'<td>'. '<a href="deleteCustomer.php?id='.$id.'">[x]</a></td>'. '</tr>';   preg_replace('/#!(\d\d\d)/', '<a href="update.php?id=${1}">${1}</a>', $viewedResult);
    echo $viewedResult;

This is the broken code which doesnt work.

© Stack Overflow or respective owner

Related posts about php

Related posts about scanning