Page 1 of 1
PHP syntax highlight code question
Posted: Sun Oct 12, 2003 4:09 pm
by like_duh44
Hi, I have a code bank where I want to highlight the php code. I came along this code:
http://www.evilwalrus.com/viewcode.php?codeEx=319 and was wondering how the heck I would use it LOL. Would I just include it in the page that outputs the code and use one of the highlighter's functions or what? Thanks
Posted: Sun Oct 12, 2003 4:56 pm
by JAM
Well, I'd rather use something similiar to BigE's (the One)
Highlight with Line Numbers snippet.
Works well when I tried it some time ago, and easier to learn from, aswell as does the trick.
Posted: Sun Oct 12, 2003 5:12 pm
by m3mn0n
Or you could easily create your own from scratch.
highlight_string()
Posted: Sun Oct 12, 2003 5:24 pm
by evilMind
highlight_file() or show_source() also work
Posted: Sun Oct 12, 2003 6:53 pm
by like_duh44
I tried the highlight_string() command, but nothin happened. Do I have to change all the < and $gt; to < and >, respectively? It should still work, right? I checked the server, I'm running php 4.2.2 with highlight.string set. What am I doing wrong? You can check out the page here:
http://www.vgapws1.myhost24.com/devcorn ... rstpost=46
Posted: Sun Oct 12, 2003 7:19 pm
by McGruff
Posted: Sun Oct 12, 2003 8:07 pm
by Cruzado_Mainfrm
when u use highlight_string(string[,donotshow) you have to specify a string for the function to highlight, and optionally, a boolean value that if it's true the highlighted string won't be printed out