Jump to content


Photo

Outputting PHP colors


  • Please log in to reply
3 replies to this topic

#1 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 04 July 2006 - 01:05 AM

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

#2 micah1701

micah1701
  • Members
  • PipPipPip
  • Advanced Member
  • 613 posts
  • LocationEllington, CT USA

Posted 04 July 2006 - 02:09 AM

you want to check out the highlight_string() and highlight_file() functions built into PHP.
should do what you want.

http://us3.php.net/highlight_string
"Confidence in the face of risk."

#3 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 04 July 2006 - 03:53 PM

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]

#4 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 04 July 2006 - 04:04 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users