> >> The full code in the loop is.
> >> Later on in the code after the loop I do
> >>
> >> echo "printing array matches ";
> >> print_r ($matches);echo "";
> >
> >$matches is going to be over-written after every time through the
loop!
> It
> >doesn't add it all up.
> >
> >Add in a
> >
> >$var[] = $
On Wed, 5 Mar 2003 12:06:41 -0500, 1LT John W. Holmes wrote:
>> The full code in the loop is.
>> Later on in the code after the loop I do
>>
>> echo "printing array matches ";
>> print_r ($matches);echo "";
>
>$matches is going to be over-written after every time through the loop! It
>doesn't add
> Also, try removing the 's' from outside the pattern matching in $ts.
> You might get back some useful information.
>
> usage: pmatch [ -cfghilnv ] '/pattern/' [ file ] ...
> -s: supress error messages about missing or unreadable files
The 's' in preg_* means something different:
"If this
What is the value of $trigger_string in your $ts variable?
Also, try removing the 's' from outside the pattern matching in $ts.
You might get back some useful information.
usage: pmatch [ -cfghilnv ] '/pattern/' [ file ] ...
-c : show only line count for each file
-f : show only filen
> >What's your actual code? How are you looking for the match in $matches?
> >If something was matched, then it'll be there.
>
> The full cod in the loop is.
>
> $cnt = 0;
> while(!feof($fp))
> {
> // Get body
> $line_in = fgets($fp,4096);
> $cnt++;
> // looking for the other
On Wed, 5 Mar 2003 10:21:30 -0500, 1LT John W. Holmes wrote:
>> $ts = '/(' . $trigger_string .')/is';
>> echo "trigger_string is $ts ";
>> $matches = array();
>> $hit = array();
>>
>> In the loop
>>
>> $hit[] = preg_match ($ts, $line_in,$matches);
>>
>> Now the $hit array fills up correctly, i
> $ts = '/(' . $trigger_string .')/is';
> echo "trigger_string is $ts ";
> $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 $h
I have
At the top of a loop
$ts = '/(' . $trigger_string .')/is';
echo "trigger_string is $ts ";
$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
8 matches
Mail list logo