Page 1 of 1

formatting code to html

Posted: Thu Jul 03, 2003 11:56 am
by 9902468
Hi,

After browsing hotscripts and some googling I decided to just ask. Is there a script that formats php (and some other languages perhaps) in to html, like the \[code\]\[/code\] command here. (Is this script freeware?)

If you know please let me know!

-9902468

Posted: Thu Jul 03, 2003 12:21 pm
by patrikG
Do you mean a <xmp>-command for PHP? If so, have a look at highlight_file.

Posted: Thu Jul 03, 2003 12:31 pm
by m3rajk
patrick-
according to an html book i have, <xmp></xmp> is deprecated and one shoud use <pre></pre> and just set a width if they have a big issue about one

9902468-
i believe php has two functions for that within itself. well.. for highlighting.
and there's htmlentities() and htmlspecialchars() that convers strings so they display as if instead of being looked at as code by html

Posted: Thu Jul 03, 2003 12:35 pm
by 9902468
Yeah, that's it. (*ashamed*)
So I should RTFM...

Thanks patrikG and m3rajk

-99