Friday, April 26, 2013

How to enable php short tags with .htaccess or with php.ini

Sometimes when we don't have access to modify configurations on server like in php.ini file and we still need to enable short tags for our php code. We can do it by .htaccess file. If you have not created any .htaccess file yet, create one in root directory of your website and add
php_value short_open_tag 1
That's it for .htaccess file.

Now if you want to enable that using php.ini and if you can...

just set
short_open_tag=On 
in php.ini at server and you are done.. :D

Enjoy!!
-Ravi Kumar Gupta 

Sunday, March 10, 2013

Invert Colors in Paint: Is it Gone? No... :)

Invert colors in new paint is not gone.. just select the part where you want to invert colors and then right click on it.. select invert colors.. :D

Wednesday, March 6, 2013

Check if Email is Valid using PHP

Hello Friends,

Sometimes when you need to check if email is valid or not in your code... just use this function..

function isValidEmail($email) {
    return preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/", $email);
}

Enjoy!!

Ravi Kumar Gupta aka D'Maverick