猿问

php 判断手机操作系统?

php 判断手机操作系统


哆啦的时光机
浏览 1075回答 1
1回答

Cats萌萌

根据useragent来完成,示例function isMobileSystem(){$agent = $_SERVER['HTTP_USER_AGENT'];if(preg_match('/ipad/i',$agent) ||preg_match('/iphone\s*os/i',$agent) ||preg_match('/android|wp7|wp8|surface|nokia|sumsang/i',$agent) ||preg_match('/wbxml|wml/i',$_SERVER['HTTP_ACCEPT'])){return true;}return false;}
随时随地看视频慕课网APP
我要回答