flunn Posted July 4, 2008 Share Posted July 4, 2008 I want to display a hundred or so lines of html/php code on a web page. I've found a code munger that does an excellent job of converting html code into ascii codes. The problem is that when I put the results between <p> tags there are no line breaks, so it's quite unreadable. When I put the ascii codes into a "TEXT AREA" box there are line breaks but not in the right places. Any suggestions as to how I might solve this problem would be much appreciated. I just want the displayed code to look like it looks in my html editor (Taco). best regards to all from flunn Link to comment https://forums.phpfreaks.com/topic/113259-problem-with-displaying-code/ Share on other sites More sharing options...
MasterACE14 Posted July 5, 2008 Share Posted July 5, 2008 use file_get_contents(); PHP function to get the file contents as it is, rather then have it squashed into a never ending line.\ Regards ACE Link to comment https://forums.phpfreaks.com/topic/113259-problem-with-displaying-code/#findComment-582089 Share on other sites More sharing options...
flunn Posted July 5, 2008 Author Share Posted July 5, 2008 Thanks, ACE, for your reply. I used the function you suggested and it certainly does come closer to getting the lines right. However there are problems: -The doctype does not appear. -None of the html tags appear. -The radio buttons I used in forms appear as actual radio buttons instead of appearing as '<input type = "radio" ...'. -Instead of being at the end of the lines of php code as they're supposed to be, the quotation marks and the semi-colons come at the beginning of the following line. If you have any other suggestions as to how I can display code that is set up in the way it's set up in my html editor, I'd be very grateful. regards to all from flunn Link to comment https://forums.phpfreaks.com/topic/113259-problem-with-displaying-code/#findComment-582205 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.