开发者

How can I get php source code to display neatly on my website?

is there some Javascript/CSS snippet or perhaps another solution to parse PHP source code intended as content on a web page so that it has highlighted elements for commands, 开发者_运维问答variables, brackets etc?


PHP has a built in feature that allows you to rename your PHP files to ".phps", this stands for "PHP Source" or something. This will display nicely formatted PHP code for you.


Check out Google Code Prettify.


SyntaxHighlighter


i don't know if i've understood well your question bu if you want a syntax highlight on a php function use the highlight_file function


Github's GISTs can be made public and included directly in your pages. I really wish they'd add tabbing to the editor window, however.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜