Andy11548 Posted January 18, 2012 Share Posted January 18, 2012 How would I show the PHP code on the website page? I'm not sure if this should be under PHP or HTML or what, but, like on the forums where you see the <?php echo 'sdfjksdf'; ?> etc. How do I make it so I can write PHP on the website? Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 18, 2012 Share Posted January 18, 2012 Use <pre> tags and htmlentities(): $php_code = "<?php echo 'sdfjksdf'; ?>"; echo "<pre>" . htmlentities($php_code) . "</pre>"; Quote Link to comment Share on other sites More sharing options...
scootstah Posted January 18, 2012 Share Posted January 18, 2012 htmlspecialchars() Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 18, 2012 Share Posted January 18, 2012 Yeah, htmlspecialchars() is a better choice. I always mix the two up. Quote Link to comment Share on other sites More sharing options...
Andy11548 Posted January 18, 2012 Author Share Posted January 18, 2012 Thanks for the help 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.