Jump to content


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


**SOLVED** How to Highlight PHP Code ?

Recommended Posts

[code]$stream = file_get_contents("sqlite.php");
echo $stream;[/code]

[b]First Problem:[/b]
paragraph doesnt work, if the text inside of the file says:
it will shown as one long line: ABC DEF

[b]Second Problem:[/b]
How to let PHP automaticly Highlight PHP Code ? I see it so often in other Boards or at Homepages, it should be easy but i have no idea how to do it. I think there must be a easier solution as to search specific Keywords. I also found following in my php.ini:
; Colors for Syntax Highlighting mode. Anything that's acceptable in
; <span style="color: ???????"> would work.
highlight.string = #DD0000
highlight.comment = #FF9900
highlight.keyword = #007700
highlight.bg = #FFFFFF
highlight.default = #0000BB
highlight.html = #000000

but how to use it ? thanks for any tipp.

google is your friend ... show_source($stream) is the solution ^^ lol, i will test it immidiatly.

i am a morron: show_source("filemanager.php"); // works perfect :D as long php.ini is set.

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.