View Full Version : PHP sample codes on websites
08-01-2007, 03:20 AM
How do you have PHP sample codes on .php pages that don't process? <code></code> doesn't work. I would like output like this:
Without it echoing anything and <?php being displayed.
08-01-2007, 03:33 AM
You need to use htmlentities() so that things like < > are not interpreted by the browser and are instead treated as literal characters and are displayed.
08-01-2007, 03:38 AM
Thanks CFMaBiSmAd ..... htmlentities() is on page 379 of my PHP book and I will look into it.
08-01-2007, 01:51 PM
also there is PHP classes out there that will put your code into colour coded output just like it does on these forums i think i seen one on phpclasses.org a while ago.
show_source(); ? But then thats for an entire page.
08-01-2007, 04:13 PM
i thought of that but as he mentioned sample code i thought i would direct him in a class...
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.