Tag Archives: read file

PHP – read text file and get contents

<?php $myfile = fopen(“file-to-read.txt”, “r”) or die(“Unable to open file!”); // Output one line until end-of-file while(!feof($myfile)) { echo fgets($myfile) . “<br>”; } fclose($myfile); ?>

Posted in PHP/MySQL | Tagged , | Comments Off on PHP – read text file and get contents