php code snippets, check valis email by php

Adding Google Adsense Vbulletin Mobile Style

If you want to put google adsense in Vbulletin Mobile Theme, go to your adsense account and choose ads for content. After that go to Styles and Templates, choose edit template from dropdown, choose ‘Ad Location Templates’. Vbulletin 3.7 has 7 locations for  ads.

The 7 locations are called:

Click to see the various ad locations available, find the one which is relavant to your ad and paste the google code in that template.

You will see header template. Now you can put adsense code in it and wait for sometime for tha ads to become active. The ads do not show for some time usually. It might take 48hours max for the ads to show, so don’t worry and wait. When ads are visible you can change their postion or color scheme as you wish.

Website RSS to Twitter (Posting to Twitter)

A lot of people would want to post  to twitter from their website. This means that the rss feed is tweeted to your twitter timeline. I will share a wonderful php script that can do it for you. Connecting your website with twitter is too easy now, using php you can post rss feed of your website to twitter. Check out the php code snippet given below and replace the values for your site and see how it works.

source: Posting to Twitter

Check Valid Email Using PHP

You can check if the email is valid or not by using regular experessions. Just copy and use the function below

function is_valid_email($email)
if( preg_match(“/+@+.+/”, $email) > 0)
return true;
return false;