Forum Moderators: coopster

Message Too Old, No Replies

PHP code viewer or display

         

hozyali

10:34 pm on Jul 14, 2010 (gmt 0)

10+ Year Member



Hi,

I am wondering for something.

I have seen a lot of sites displaying php tricks and tips. most of them display php code snippets in a different container and it also maintains the php code colors and blocks etc.

an example is like
http://www.noupe.com/php/php-regular-expressions.html


the above link shows the php code snippets in a white container with code colors etc and that is copyable too.

please advise.

thanks

dreamcatcher

7:39 am on Jul 15, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe most of them use a Syntax Highlighter. The example you gave (a Wordpress site) uses an open source one:

[alexgorbatchev.com...]

dc

hozyali

8:26 am on Jul 15, 2010 (gmt 0)

10+ Year Member



oh great, thanks a lot for your help.

Just others to know, I found a very good wordpress plugin for syntax highlighting

http://wordpress.org/extend/plugins/syntax-highlighter-and-code-prettifier/


and its supported for the latest version of wordpress.

coopster

11:55 am on Jul 15, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Did you know that PHP has built-in support for highlighting?
highlight_file [php.net]
highlight_string [php.net]

hozyali

12:53 pm on Jul 15, 2010 (gmt 0)

10+ Year Member



Yes, I didn't know how to use this kind of thing in wordpress posts.

Thanks for your help thou.