Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Use feof() to read through a file, line by line, until end-of-file is reached
SUBMITTED BY:
henry1874w
DATE:
June 17, 2017, 1:39 p.m.
FORMAT:
Text only
SIZE:
256 Bytes
Raw
Download
Tweet
HITS:
314
Go to comments
Report
<!DOCTYPE html>
<html>
<body>
<?php
$myfile = fopen("webdictionary.txt", "r") or die("Unable to open file!");
// Output one line until end-of-file
while(!feof($myfile)) {
echo fgets($myfile) . "<br>";
}
fclose($myfile);
?>
</body>
</html>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus