您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php如何判断是否isPhone和is_weixin的实例

2025/11/26 9:37:22发布22次查看
protected function isphone(){ $agent = strtolower($_server['http_user_agent']); //pc请求头信息数组 $pc_arr=array('windows nt','macintosh','ipad','baiduspider','spider'); //如确认为移动端则更改默认值 //没找到pc数组元素时判断为移动端 foreach($pc_arr as $k => $v){ $pc=strpos($agent, $v) ? true : false; if($pc){ return false; } } return true; }
/** * 判断是否微信 * liangzheng 2014-12-03 */ protected function is_weixin(){ if ( strpos($_server['http_user_agent'], 'micromessenger') !== false ) { return true; } return false; }
以上就是php如何判断是否isphone和is_weixin的实例的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product