formatting code to html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
9902468
Forum Commoner
Posts: 89
Joined: Thu Jun 06, 2002 6:39 am
Location: Europe

formatting code to html

Post 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
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Do you mean a <xmp>-command for PHP? If so, have a look at highlight_file.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post 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
User avatar
9902468
Forum Commoner
Posts: 89
Joined: Thu Jun 06, 2002 6:39 am
Location: Europe

Post by 9902468 »

Yeah, that's it. (*ashamed*)
So I should RTFM...

Thanks patrikG and m3rajk

-99
Post Reply