thank you
need to display some php/html code on my webpage
Moderator: General Moderators
need to display some php/html code on my webpage
i have a file, file A... i want to display the contents of that file on a webpage, i have done this but as file A is html/php it displays part of the code but displays other parts as you would see them upon loading file A as a webpage.. i just want to display the code as text.. any ideas?
thank you
thank you
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: need to display some php/html code on my webpage
use htmlspecialchars() to format the text - it'll replace things like < with < making sure it shows up as text not HTML 
edit: e.g.
$text = "<html>blah</html";
$text = htmlspecialchars($text);
hth
edit: e.g.
$text = "<html>blah</html";
$text = htmlspecialchars($text);
hth
Re: need to display some php/html code on my webpage
ah ha, excellent thanks for the quick response 