PHP General Learning scripts

PHP General Learning Scripts Here are few things that generally need in PHP coding. Sleep in PHP/ Pause in PHP Sleep function is used for sleep or pause a script in PHP. Sleep(10) How to check PHP Version version_compare function is used to check version comparison… Read More

How to Detect mobile device in PHP

For mobile detection check environment variable HTTP_IS_MOBILE , Set HTTP_IS_MOBILE to 1, if it is equal to any of user agent. Set SetEnvIfNoCase  variable for user agent in htaccess . SetEnvIfNoCase User-Agent android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile HTTP_IS_MOBILE=1 Hence in PHP we write code as follow… if(isset($_SERVER[‘HTTP_IS_MOBILE])) {     echo “This is… Read More