05-03-2009, 03:32 AM
|
#2 (permalink)
|
|
The Addict
Join Date: Jun 2008
Posts: 335
Thanks: 2
|
PHP Code:
<?php
$test = array('Wfjheighe','ISBN:454656','ISBN:9090943'); $term = '/ISBN:(.*?)/Us';
foreach( $test as $id ) { if( preg_match($term, $id, $match) ) { echo $match[0], '<br />'; } }
?>
This'll output what you want, how ever for future references some pointers.
when using echo to output data please the comma instead of the period to concatenate strings it is faster.
when you're processing strings without variables in them use single quotes as PHP doesn't process them.
Unless I'm mistaken standards mandate html be lowercase so <BR /> should <br />
P.S - I am not sure this would be the best method.
|
|
|
|