Php fgetc Function
Fgetc
(PHP 4 and PHP 5)
Fgetc-get the character pointer from the file
Description
String fgetc (resource $ processing)
Gets a character pointer from a given file.
Parameters
Handle
The file pointer must be valid and must point to a file that successfully opens fopen () or fsockopen () (and has not closed fclose ()).
Return Value
Returns a string containing a single character to read the file pointed by processing. Returns the false eof analysis.
Warning
This function may return a Boolean error, and can return a non-Boolean value calculated as false, such as 0 or "". Read some Boolean values carefully for more information. Use the ===operator to test the return value function.
Instance
Example #1 fgetc ()
$ Fp = fopen('somefile.txt ', 'R ');
If (! $ Fp ){
Echo 'could not open file somefile.txt ';
}
While (false! ==( $ Char = fgetc ($ fp ))){
Echo "$ charn ";
}
?>