Re: line break part2
| From: | Philip Olson | Date: | Fri, 27 Apr 2001 18:32:11 +0000 |
| Subject: | Re: line break part2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50675@lists.php.net to get a copy of this message | ||
Have a look at file() :
http://www.php.net/manual/en/function.file.php
$lines = file('log_test.txt');
echo $lines[4]; // prints line #5
regards,
philip
On Fri, 27 Apr 2001, Gary wrote:
> Thanks for everyone's help on the original question. Now that I have
> gotten the line breaks in a file, How do I get the file out with the
> breaks? Also, does anyone know of a good tutorial on file formatting.
>
>
> <?php
> $location = "log_test.txt";
> $toread = fopen($location, "r");
> set_magic_quotes_runtime(0);
> $content = fread($toread, filesize($location));
> fclose($toread);
> echo "$content";
> ?>
>
> TIA
> Gary
>
>
> --
> 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
>