Re: File-handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx 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
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux