PHP fgetc functions
Fgetc
(PHP 4, PHP 5)
Fgetc-Gets the character from the file pointer
Describe
String fgetc (resource $ processing)
Gets a character from the given file pointer.
Parameters
Handle
The file pointer must be valid and must point to a file that successfully opened fopen () or Fsockopen () (and has not yet closed fclose ()).
return value
Returns a string containing a single character read by the file, indicated by the processing. Returns the EOF analysis for false.
Warning
This feature may return a Boolean error, and can also return a non-Boolean value that evaluates to false, such as 0 or "". Please read some of the booleans carefully for more information. Use the = = = operator to test the return value of this function.
Instance
Example # 1 fgetc () example
$fp = fopen (' somefile.txt ', ' R ');
if (! $fp) {
Echo ' Could not open file Somefile.txt ';
}
while (false!== ($char = fgetc ($fp))) {
echo "$charn";
}
?>
http://www.bkjia.com/PHPjc/445481.html www.bkjia.com true http://www.bkjia.com/PHPjc/445481.html techarticle php fgetc function fgetc (PHP 4, PHP 5) fgetc-Gets the character from the file pointer describing the string fgetc (resource $ processing) gets a character from the given file pointer. Parameter handle ...