use fgets or fscanf (>= PHP 4.0.1)instead of fread.
Fgets(fp, length) ends reading when length - 1 bytes have been read, on a newline 
(which is included in the return value), 
or on EOF (whichever comes first). 

----- Original Message ----- 
From: "Jan Grafström" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 2001. május 6. 19:04
Subject: [PHP] Can php give me row number?


> Hi!
> First I wan´t to thank those kind guys who helped me with the search for
> words in a string. It works fine and here goes my file:
> ---
> $fd = fopen($filename1, "r");
> $string = fread($fd, filesize($filename1));
> fclose($fd);
> if (eregi("$word", $string)) {
>     print "found the word";
> }
> -----
> Now I also wan´t to know to in which row the word was found.
> Is there a simple way to add some code?
> 
> Thanks for any tips.
> Regards
> Jan
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to