Re: File-handling
| From: | Ian Firla | Date: | Fri, 17 Dec 2004 10:32:47 +0000 |
| Subject: | Re: File-handling | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-204567@lists.php.net to get a copy of this message | ||
fgets uses the resource created by fopen.
Read the manual:
http://it.php.net/fopen
http://it.php.net/fgets
look at the example:
<?php
$handle = fopen("/tmp/inputfile.txt", "r");
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
echo $buffer;
}
fclose($handle);
?>
Ian
On Fri, 2004-12-17 at 11:24 +0100, gustav@varupiraten.se wrote:
> Hi there!
>
> Can someone explain the major difference between fgets and fopen? Which is
> the best together with plain textfiles? and why?
>
> eof and feof. What's the difF? *don't get it*
>
> When using fget. Is it something special you should think when taking care
> of line-breaks? (/n, /r/n ...)
>
> /G
>