fgetc() example

This is the example of fgetc().

 
 

Share on Google+Share on Google+

fgetc() example

Ads

This is the example of fgetc().

fgetc() command

The command fgetc() returns a single character from an open file. It is primarily used in small files and runs slowly. It returns False if the location of file pointer is at end of file. 

Synopsis

<?php
$file=fopen("New Text Document .txt","r") or exit("Unable to open file!");

while (!feof($file))
{
echo fgetc($file);
}
fclose($file);
?>

Advertisements

Posted on: July 30, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles