Examples ¶
Example #1 Reading a file line by line
<?php
$handle = @fopen("/tmp/inputfile.txt", "r");
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
echo $buffer;
}
if (!feof($handle)) {
echo "Error: unexpected fgets() fail\n";
}
fclose($handle);
}?>
http://php.net/manual/en/function.fgets.php
No hay comentarios:
Publicar un comentario