Home Tutorial Php Examples fgetc() example

 
 

fgetc() example
Posted on: July 30, 2009 at 12:00 AM
Advertisement
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);
?>

Advertisement

Related Tags for fgetc() example:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 30, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com