viernes, 14 de octubre de 2016

Reading a file line by line

Examples ¶

Example #1 Reading a file line by line
<?php
$handle 
= @fopen("/tmp/inputfile.txt""r");
if (
$handle) {
    while ((
$buffer fgets($handle4096)) !== 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