It is often required to publish some code snippets in the blog on PHP or other popular languages like Python, Ruby... Here is simple way to do this..

Use nice JavaScript code formatting library. Just enter program text in <pre><code></code></pre> tags in any part of post, include CSS and library and voila:

This code should be appended into HTML:

<script src="http://yandex.st/highlightjs/5.12/highlight.min.js"></script>
``` ```
<link rel="stylesheet" href="http://yandex.st/highlightjs/5.12/styles/vs.min.css">
<script>
  hljs.initHighlightingOnLoad();
</script>
Library itself is available through Yandex content distribution network(CDN), so no installation is needed.

Links

Thanks to Ivan Sagalaev.