Output html string in browser without rendering

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
SmokyBarnable
Forum Contributor
Posts: 105
Joined: Wed Nov 01, 2006 5:44 pm

Output html string in browser without rendering

Post by SmokyBarnable »

Is there a way to output a string that contains html to the browser just so it shows the html code, for testing purposes, and doesn't actually render.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

htmlspecialchars()?

Edit: Don't use htmlentities(), use htmlspecialchars() instead. Why? http://www.phpwact.org/php/i18n/utf-8
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

should note the problems of htmlentities() which you've addressed only is for php4
Post Reply