if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|iphone|ipad|ipod|android|xoom)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) $mobile_browser++;
if ((isset($_SERVER['HTTP_ACCEPT'])) and(strpos(strtolower($_SERVER['HTTP_ACCEPT']), 'application/vnd.wap.xhtml+xml') !== false)) $mobile_browser++;
if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) $mobile_browser++;
if (isset($_SERVER['HTTP_PROFILE'])) $mobile_browser++;