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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
Open in new window