Jump to content

Archived

This topic is now archived and is closed to further replies.

cmgmyr

Outputting PHP colors

Recommended Posts

I am working on adding some tutorials to my personal site. When I add in php (for example) I want it to be formatted like it is in here or in coding software with the different colors and everything. Currently I have tinyMCE as the editor for the tutorials. I have tried the php plugin for it...which doesn't do anything. Is there something that I can use, or make, in order to have the text output in the colors that they should?

Thanks,
-Chris

Share this post


Link to post
Share on other sites
you want to check out the highlight_string() and highlight_file() functions built into PHP.
should do what you want.

[url=http://us3.php.net/highlight_string]http://us3.php.net/highlight_string[/url]

Share this post


Link to post
Share on other sites
I tried that out and it did half of what it it supposed to do. How do I get rid of the extra tags that show up without messing anything else up

Here is the screen shot


[attachment deleted by admin]

Share this post


Link to post
Share on other sites
Nevermind...I got it.

What I had to do was manually add in the BB PHP tags, then when I output it I search for those and replace with the highlight string.

Let me know if anyone wants my code

-Chris

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.