



(24 votes)// readfile.php by detour@metalshell.com // // Read in text from a file. // // http://www.metalshell.com/ // $yourfile = '/tmp/file'; // Open the file for reading. $fd = fopen($yourfile, "r"); // Read in all of the data in one big hunk $data = fread($fd, filesize($yourfile)); // Close the file. fclose($fd); // Convert all return char's to <br> for html $data = ereg_replace("\n", "<br>", $data); // Print it all out. echo $data;