If memory serves, $match will contain an array whose 0th element is the entire string and whose 1st element contains whatever is matched in the first (), 2nd element matches the second () and so on.
Check the manpage for more... and when testing things like this out try adding the following for debugging reasons: print("<pre>"); print_r($match); print("</pre>"); that will let you see what $match looks like in its entirety. good luck On Thu, 19 Sep 2002, Anthony Ritter wrote: > I'm having difficulty understanding what the array does or refers to in the > eregi() function using php. > > Listing below are returned strings with > [0] > [1] > [2] > .............................................. > > <? > $fp =fopen("C:\\TextFiles\\Test.htm","r"); > $content = fread($fp,100000); > eregi("<b>(.*)<hr width",$content,$match); > $FinalLine=$match[2]; > echo "$FinalLine"; > ?> > ........................... > > quick brown fox jumped over the lazy dog // output with $match[1] > ................................. > > quick brown fox jumped over the lazy dog. > <hr width // output with $match[0] > .................................. > > file://output is nothing with $match[2] > ................................... > > Description: > int eregi ( string pattern, string string [, array regs]) > ........................ > > Thank you. > Tony Ritter > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php