(PHP 5 >= 5.1.0)
SplFileObject::fgetc — Gets character from file
Gets a character from the file.
Esta función no tiene parámetros.
Returns a string containing a single character read from the file or FALSE on EOF.
Esta función quizá devuelve Boolean FALSE, pero quizá también devuelve un valor non-Boolean que se evaluará como FALSE, como 0 o "". Por favor lea la sección en Booleans para más información. Use el operador === para testear el valor devuelto por esta función.
Example #1 SplFileObject::fgetc() example
<?php
$file = new SplFileObject('file.txt');
while (false !== ($char = $file->fgetc())) {
echo "$char\n";
}
?>