PHP CODE TO DETECT MOBILE BROWSERS Detecting Handheld devices like , mobile phones, PDA, WAP enabled devices, WAP enabled Browsers is possible with PHP Scripting. The code that detects mobile devices: $wapprofile=$_SERVER['HTTP_X_WAP_PROFILE']; // mobile profile $httpprofile=$_SERVER['HTTP_PROFILE']; // http profile $browser=$_SERVER['HTTP_USER_AGENT']; // user-agent info // — MOBILE DETECTION — // $wml=0; $xhtml=0; if(preg_match(‘/(midp|wap|up.browser|up.link|mmp|symbian|smartphone|phone)/i’,strtolower($browser))) { $wml++; } if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),’application/vnd.wap.xhtml+xml’)>0)) { $xhtml++; $wml++; } if(strpos(strtolower($_SERVER['HTTP_ACCEPT']),’xhtml+xml’)>0) { $xhtml++; } if(isset($wapprofile) or isset($httpprofile)) { $wml++; } $mobile_ua = strtolower(substr($browser,0,4)); $mobile_agents = array( ‘doco’,'eric’,'hipt’,'inno’,'w3c ‘,’audi’,'avan’,'benq’,'bird’,'blac’, ‘blaz’,'brew’,'cell’,'oper’,'palm’,'pana’,'pant’,'cldc’,'cmd-’,'dang’, ‘ipaq’,'java’,'jigs’,'kddi’,'keji’,'leno’,'lg-c’,'lg-d’,'lg-g’,'lge-’, ‘maui’,'maxo’,'midp’,'mits’,'mmef’,'mobi’,'mot-’,'moto’,'mwbp’,'nec-’, ‘newt’,'noki’,'phil’,'play’,'port’,'prox’,'acs-’,'alav’,'alca’,'amoi’, ‘qwap’,’sage’,’sams’,’sany’,’sch-’,’sec-’,’send’,’seri’,’sgh-’,’shar’, ’sie-’,’siem’,’smal’,’smar’,’sony’,’sph-’,’symb’,'t-mo’,'teli’,'tim-’, ‘tosh’,'tsm-’,'upg1′,’upsi’,'vk-v’,'voda’,'wap-’,'wapa’,'wapi’,'wapp’, ‘wapr’,'xda-’,'webc’,'winw’,'winw’,'xda’); if(in_array($mobile_ua,$mobile_agents)){ $wml++; } if(strpos(strtolower($_SERVER['ALL_HTTP']),’OperaMini’)>0) { $xhtml++; $wml++; } if(strpos(strtolower($browser),’windows’)>0) { $xhtml++; } if($xhtml [...]
Continue reading...25. May 2008
Enhanced Data Rates for GSM Evoluation Enhanced Data rates for GSM Evolution (EDGE) or Enhanced GPRS (EGPRS) or IMT Single Carrier (IMT-SC) is a digital mobile phone technology that allows to increased data transmission rates and improved data transmission with reliability. Where EDGE is generally classified as 2.75G, although it is part of ITU’s 3G definition. The EDGE [...]
Continue reading...
15. October 2008
1 Comment