Detect mobile browser [duplicate]
Have my user agent code: <?php /* USER-AGENTS ================================================== */ function check_user_agent ( $type = NULL ) { $user_agent = strtolower ( $_SERVER[‘HTTP_USER_AGENT’] ); if ( $type == ‘bot’ ) { // matches popular bots if ( preg_match ( “/googlebot|adsbot|yahooseeker|yahoobot|msnbot|watchmouse|pingdom\.com|feedfetcher-google/”, $user_agent ) ) { return true; // watchmouse|pingdom\.com are “uptime services” } } else if … Read more