1- Use syntaxhighlighter:

Homepage: SyntaxHighlighter in Google Code
Download: syntaxhighlighter
Usage: manual
I like this tool because it will automatic convert the code after the web browser loaded. Because that, the code will not be formated and you can edit it later easily.
It support so many language: PHP, SQL Query, Java, Python, C# .....It's cool, right?
2- Using PHP's Built-in Source Highlighter:
PHP offer two functions for highlighting PHP code:
A Quick Example
Let's take a look at an example of the
This script displays a simple textbox into which you can type or paste the PHP code you want to highlight.
3- Java2HTML Converter (for java blog):
This is also cool converter. Java2Html was write with java language, it converts Java (and other) source code (complete files or snippets) to HTML, RTF, TeX and XHTML with syntax highlighting.
Homepage: Java2HTML Converter
Download: download here
Java2HTML can be used as Eclipse plugin and it's useful for fastly convert in time.
However, after converted, the code will be formated and it'll hardly to edit later if you want to updated your entry.
4- CodeColorizer: Free Tool to Colorize Code in HTML or RTF.
This application allows you to generate HTML or RTF so you can colorize:
Homepage: CodeColorizer
Download: download here
Things to notice is that it generates the simplest Html possible to achieve the right formatting. It colorizes in the same place ASP.NET code, HTML, C# code, javascript code, CSS styles, and more...
5-Csharpfriends.com Online Code Formatting:
Online site formatting with following code: C#, VB.NET, J# and T-SQL.
Its useful for who dont want to install any program into computer and dont need to add any code into webpage to do automaticlly, you just do it online, copy and go back to your working
Link to converter: CSharpfriend Online Code Fomartting
If you found some webpages or tools can do something like that, please correct me. Pleased to make you work perfectly.
PHP offer two functions for highlighting PHP code:
highlight_file()
and highlight_string()
. Both functions return the same results, but each has its own specific input parameters. As their names suggest, the first function takes the filename of the PHP script whose code is to be highlighted, while the second takes the input as a string.A Quick Example
Let's take a look at an example of the
highlight_string()
function in action:<?php include_once 'init.inc.php'; if (!empty($_POST['text'])){ echo '<div style="border: solid 1px orange; padding: 20px; margin: 20px">'; highlight_string($_POST['text']); echo '</div>'; } ?> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <textarea name="text" style="width: 300px; height: 200px"><?php echo @$_POST['text']; ?></textarea> <br /> <input type="submit" /> </form>
This script displays a simple textbox into which you can type or paste the PHP code you want to highlight.
3- Java2HTML Converter (for java blog):

Homepage: Java2HTML Converter
Download: download here
Java2HTML can be used as Eclipse plugin and it's useful for fastly convert in time.
However, after converted, the code will be formated and it'll hardly to edit later if you want to updated your entry.
4- CodeColorizer: Free Tool to Colorize Code in HTML or RTF.
This application allows you to generate HTML or RTF so you can colorize:
- C#, VB.NET, J#, Javascript, Cobol, Algol
- HTML, XML, XSLT, .Config
- T-SQL
- CSS, and many more...

Download: download here
Things to notice is that it generates the simplest Html possible to achieve the right formatting. It colorizes in the same place ASP.NET code, HTML, C# code, javascript code, CSS styles, and more...
5-Csharpfriends.com Online Code Formatting:
Online site formatting with following code: C#, VB.NET, J# and T-SQL.
Its useful for who dont want to install any program into computer and dont need to add any code into webpage to do automaticlly, you just do it online, copy and go back to your working
Link to converter: CSharpfriend Online Code Fomartting
If you found some webpages or tools can do something like that, please correct me. Pleased to make you work perfectly.