Re: preg_match fails to fill $matches

From: Date: Wed, 05 Mar 2003 15:21:30 +0000
Subject: Re: preg_match fails to fill $matches
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138285@lists.php.net to get a copy of this message
> $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. What's your actual code? How are you looking for the match in $matches? If something was matched, then it'll be there. ---John Holmes...

« previous php.general (#138285) next »