rgb192
asked on
return every row that has search term
i want to return every row that has search term
this code only returns the first row that has search term
this code only returns the first row that has search term
<?php
$string="
term1 text
Text term2 text
";
preg_match('^.*term.*^',$string,$matches);
echo $matches[0];
?>
ASKER
Array ( [0] => Array ( [0] => Array ( [0] => term [1] => 0 ) [1] => Array ( [0] => 1 text Text term [1] => 6 ) ) [1] => Array ( [0] => Array ( [0] => term [1] => 2 ) [1] => Array ( [0] => term [1] => 19 ) ) )
is the output
can
term1 text
Text term2 text
be output
is the output
can
term1 text
Text term2 text
be output
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks
Open in new window