Query: fgetc
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
FGETC(3) 1 FGETC(3) fgetc - Gets character from file pointerSYNOPSISstring fgetc (resource $handle)DESCRIPTIONGets a character from the given file pointer.PARAMETERSo $handle -The file pointer must be valid, and must point to a file successfully opened by fopen(3) or fsockopen(3) (and not yet closed by fclose(3)).RETURN VALUESReturns a string containing a single character read from the file pointed to by $handle. Returns FALSE on EOF. Warning This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.EXAMPLESExample #1 A fgetc(3) example <?php $fp = fopen('somefile.txt', 'r'); if (!$fp) { echo 'Could not open file somefile.txt'; } while (false !== ($char = fgetc($fp))) { echo "$char "; } ?>NOTESNote This function is binary-safe.SEE ALSOfread(3), fopen(3), popen(3), fsockopen(3), fgets(3). PHP Documentation Group FGETC(3)
Related Man Pages |
---|
fgets(3) - xfree86 |
fread(3) - php |
fgetc(3) - opendarwin |
getc(3) - php |
fpassthru(3) - php |