How to add PHP tags to blogs


Hey guys i’ve found out how to add php tags and hence examples to the blog. We just have to replace the ‘<‘ symbol in tags with a &lt; statement, which will render the ‘<‘ symbol for us. Its as easy as that. The problem is that google or blogspot server supports the php and hence when i quote examples, they were actually parsing it, i.e, executing the php code. So in order to prevent that we’ll render the ‘<‘ symbol in the other way, and presto it works. Also put the examples within a <pre> </pre>, it will show the examples as a code-fragment(i.e, in that style).
eg:

<?php
echo "hello World";
?>

The syntax-highlighting of the code is based on the post-
http://binil.wordpress.com/2007/09/06/formatting-source-in-blogs-hosted-on-wordpress. Now i’ll quote more php examples in the blog.

5 thoughts on “How to add PHP tags to blogs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s