hey.. thank you..
but is it possible to read the last lets say 10 lines from a file ?


----- Original Message -----
From: "Niklas Lampén" <[EMAIL PROTECTED]>
To: "Tauntz" <[EMAIL PROTECTED]>; "Php-General" <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 3:28 PM
Subject: RE: [PHP] How do I read the first n lines from a file?


> You can do this:
>
> $i = 0;
> $fp = fopen("list.txt", "r");
> while (!feof($fp) && $i < 10) {
> $i++;
> $Text = fgets($fp, 4096); // Reads first 4096 characters from a row.
> print "$Text<br>\n";
> };
>
>
> Niklas
>
> -----Original Message-----
> From: Tauntz [mailto:[EMAIL PROTECTED]]
> Sent: 28. elokuuta 2001 14:13
> To: [EMAIL PROTECTED]
> Subject: [PHP] How do I read the first n lines from a file?
>
>
> hi !
>
> I have a simmple question :)..
>
> Lets say that I have a file called:
> list.txt
> and I want to take the first 10 lines from it & echo it to the browser ?
>
> thank you
> [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