944,123 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2326
  • PHP RSS
May 18th, 2005
0

coloring of source code

Expand Post »
hello,
today i visited the source code section of daniweb and i was amazed to see that codes inside text box were colored according to their syntax.here is the url of the page.
http://www.daniweb.com/code/snippet25.html
in which language this is coded .can i do this in php .can anybody provide me some help.perhaps cscgal can help me out.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
ashishjha54 is offline Offline
28 posts
since May 2005
May 22nd, 2005
0

Re: coloring of source code

The color coding was accomplished by a perl syntax highlighter known as the beautifier (www.beautifier.org), later ported to php. Alternatively, there are two built-in php functions known as highlight_string() and highlight_file() which output syntax highlighted PHP. For example, [php]

<?php
highlight_string('<?php phpinfo(); ?>');
?> [/php]

For more information,
http://us4.php.net/manual/en/functio...ght-string.php
http://us4.php.net/manual/en/functio...light-file.php
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 163
The Queen of DaniWeb
cscgal is offline Offline
13,646 posts
since Feb 2002
May 22nd, 2005
0

Re: coloring of source code

i thought i will not get reply, thats why i started coding my own function.my function replaced all the keywords with custom colors and it also changed the colors of the comments, but it had some bugs.but now i know the site i will be able to complete my function easily.
Reputation Points: 10
Solved Threads: 0
Light Poster
ashishjha54 is offline Offline
28 posts
since May 2005
May 23rd, 2005
0

Re: coloring of source code

also make sure to check out GeSHi

http://qbnz.com/highlighter/

this will highlight virtually any language you can think of and has sooo many options
Reputation Points: 13
Solved Threads: 4
Posting Whiz
paradox814 is offline Offline
351 posts
since Oct 2004
May 24th, 2005
0

Re: coloring of source code

I use PHP Coder Pro.... Nice utility with some built in functionality... Best of all... it is FREE!

www.phpide.com/go/downloads.htm
Reputation Points: 10
Solved Threads: 0
Newbie Poster
cputek2k is offline Offline
11 posts
since May 2005
May 24th, 2005
0

Re: coloring of source code

Quote originally posted by cputek2k ...
I use PHP Coder Pro.... Nice utility with some built in functionality... Best of all... it is FREE!

www.phpide.com/go/downloads.htm
hello cputek2k,
we are talking about highlighting source codes in web-pages not in IDE.if you know about it ,please tell me. the link u posted was down,but i guessed from the url that it could be IDE download site.
Reputation Points: 10
Solved Threads: 0
Light Poster
ashishjha54 is offline Offline
28 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP/MySQL Programming
Next Thread in PHP Forum Timeline: Automating a script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC