KingOfHeart Posted April 15, 2010 Share Posted April 15, 2010 if(file_exists($file)) { $fh = fopen($file, 'r'); $fr = fread($fh, 1024); fclose($fh); echo $fr; return; } This doesn't seem to work on php files. I'm assuming it's because of all the HTML and php data. How do I just print everything as text? Quote Link to comment Share on other sites More sharing options...
teamatomic Posted April 15, 2010 Share Posted April 15, 2010 $fr=htmlentities($fr); echo $fr; HTH teamatomic Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 15, 2010 Share Posted April 15, 2010 You also need to use ENT_QUOTES as the second parameter in the htmlentities() function call so that single quotes in the 'code' being output don't break the html on page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.