Display pages php code?
View Single Post
01-24-2008, 11:45 PM
Join Date: Nov 2007
Originally Posted by
I am going to try to use it for a tutorial, like one of those "type this code" things, so when you go in the browser you can see the php code and the output at the same time.
highlight_file will do what you want. Create a page with your tutorial and then whenever you have source code, create a separate file for the source code. Use that function to put the source code in your tutorial and have a link to see the file run.
If you want this all in the same file then where you want to have the code displayed you'll have to write out the code so it can be displayed. Where you want the results to be displayed, then you write the code so that it is executable and it outputs the results.
The Following User Says Thank You to wGEric For This Useful Post:
View Public Profile
Send a private message to wGEric
Visit wGEric's homepage!
Find More Posts by wGEric