Im writing a sample php code and I want to display it on the webpage. But the damn thing keeps interpetting it instead of just displaying it. Is there some special character I need to put before all my php code that I want displayed versus interpetted?
Change < to < and > to > in the html/php file... Not 100% sure if this works, but I think it does cause that's how you also display html code.
I think one of these two functions are what you're looking for. http://php.net/highlight_file and http://php.net/highlight_string
You can use some PHP built in function highlight_string() highlight_file() OR .phps extension (not enable on some server) like myfile.phps You can also use a custom function below: http://www.brainerror.net/scripts_php_highlight.php
If you want to get all fancy and display code on your site as it shows up here, i.e. <?php echo "A little sample php code echo."; ?> PHP: then you can also look at Geshi and the PEAR Text_Highlighter class. As well as displaying php code you can display a whole host of other languages.