preg_match fails to fill $matches
| From: | {R}ichard Ashton | Date: | Wed, 05 Mar 2003 15:07:24 +0000 |
| Subject: | preg_match fails to fill $matches | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138280@lists.php.net to get a copy of this message | ||
I have
At the top of a loop
$ts = '/(' . $trigger_string .')/is';
echo "trigger_string is $ts <br>";
$matches = array();
$hit = array();
In the loop
$hit[] = preg_match ($ts, $line_in,$matches);
Now the $hit array fills up correctly, if the trigger string is on the
line just read in, putting 1 or 0 in $hits. But the string that
triggered the match is not put in $matches. The manual says it should
be.
Anyone any idea what I am doing wrong ?
{R}