july09 Posted July 9, 2007 Share Posted July 9, 2007 Hey all I'm writing my first PHP program which is supposed to fetch an external HTML source and display it. I have the HTML source stored as the variable $pageContents, but when I try to echo it out the browser renders the HTML. This is understandable, but can I somehow just output the raw HTML code without the browser trying to render it? Cheers Quote Link to comment Share on other sites More sharing options...
chocopi Posted July 9, 2007 Share Posted July 9, 2007 I don't know the clever way of doing it but you could always put it into a textarea ~ Chocopi Quote Link to comment Share on other sites More sharing options...
marcus Posted July 9, 2007 Share Posted July 9, 2007 htmlspecialchars() Quote Link to comment Share on other sites More sharing options...
july09 Posted July 9, 2007 Author Share Posted July 9, 2007 thanks for the help, I used strip_tags($pageContents); and voila, it even strips away all that nasty HTML which I didn't need in the first place. This would've taken me 2 hours to do in J2EE 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.