web analytics

How to use Group Names in PHP preg_match() regex to index matched results by names instead of numeric values

Using regular expressions is a very effective way to find a sub-string or all matched sub-string from a given string or text. But when you call them they give you matched results in a array with numeric indexes which is not helpful enough to get your data out of the matched results. Following is the … Read more

How to Easily highlight source codes in content?

Syntax Highlighter
If you want to publish source codes as part of your content, you should consider highlighting the source codes in the content, not just for beautification, it helps the reader to see something familiar. In this post I am going to present a way of highlighting source codes in content which is applicable in all platforms. This easy way to highlight source codes in contents would only requires JS and CSS support.
 
So if you are a blogger who writes on computer programming and publish source codes in your blog post or if you just want to publish some source codes in your website, then what you can do to stand-out the code from other text is
  • Use <code /> tags
  • Use <pre /> tags
Cool. It will look like codes but not look like as it looks like in your favorite code editor, with different colors for constants, variables, functions, strings etc. along with line numbers.
 
So, what you want to do is to highlight source codes and make them appearing like in a code editor, which is just not for colors, but for more readability too.
 

Read more

If you want to publish source codes as part of your content, you should consider highlighting the source codes in the content, not just for beautification, it helps the reader to see something familiar. In this post I am going to present a way of highlighting source codes in content which is applicable in all platforms. This easy way to highlight source codes in contents would only requires JS and CSS support.
 
So if you are a blogger who writes on computer programming and publish source codes in your blog post or if you just want to publish some source codes in your website, then what you can do to stand-out the code from other text is
  • Use <code /> tags
  • Use <pre /> tags
Cool. It will look like codes but not look like as it looks like in your favorite code editor, with different colors for constants, variables, functions, strings etc. along with line numbers.
 
So, what you want to do is to highlight source codes and make them appearing like in a code editor, which is just not for colors, but for more readability too.
 

Read more

How to experiment with ad units in google adsense.

Google adsense is my number 1 ad provider because of a lot of reasons like blocking inappropriate ad networks, blocking inappropriate ads, blocking low paying ad networks from serving ads,  customizing ad styles etc. and mostly this one. You can experiment with the ad units you use to publish ads. Experimenting ad units includes publishing … Read more