Re: Can php give me row number?
| From: | Gyozo Papp | Date: | Sun, 06 May 2001 17:23:52 +0000 |
| Subject: | Re: Can php give me row number? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51636@lists.php.net to get a copy of this message | ||
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" <jan@lillemanshus.com>
To: <php-general@lists.php.net>
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: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>