Created
May 3, 2014 01:15
-
-
Save madeinnordeste/812230b5d27d4d7da240 to your computer and use it in GitHub Desktop.
PHP - Read text file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Open file | |
$handler = fopen ("file.txt", "r"); | |
//Read file, line to line | |
while (!feof ($handler)) { | |
//Read one line | |
$line = fgets($handler, 4096); | |
//print line | |
echo $line."<br>"; | |
} | |
//Close handler | |
fclose ($handler); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment