function get_device_type(){
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
$type = 'other';
if(strpos($agent, 'iphone') || strpos($agent, 'ipad')){
$type = 'ios';
}
if(strpos($agent, 'android')){
$type = 'android';
}
return $type;
}
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
$type = 'other';
if(strpos($agent, 'iphone') || strpos($agent, 'ipad')){
$type = 'ios';
}
if(strpos($agent, 'android')){
$type = 'android';
}
return $type;
}
解决方案 »
- 如可以把问题解决者,可以得到本人赠送的实体礼物
- 请假大神,幻灯片的更新并插入如何实现
- phpmyadmin连接MYSQL数据库时登陆的问题。新建立的帐号进不去。详细请进来看
- 显示图片的问题!!请大家帮忙!
- "http:\/\/(\w{1,9})+.yeshere.com\/"为何不能匹配http://zairwolf.yeshere.com/??
- 你说,我说--qq秀的功能是怎么做的?
- 懂mysql的请进~!
- 问一个菜鸟问题,怎样才能点击图片提交表单内容?
- 如何在php程序中调用C++程序模块
- Linux环境下PHP,PostgreSql的EXPERT请进!!!
- 请问php有没有将字符串当做公式处理数据的功能?
- 请问php怎么制作商品检索系统,类似于淘宝的那种?
Http.setRequestProperty("User-Agent","Mozilla/5.0 Android");
用fiddler截了下自己手机的数据包,居然真的带了useragent
不确定是否乱七八糟的安卓机型都能带上
截一下IOS和windows phone的看看吧