PHP 扫码识别信息
public function order_source()
{
$useragent = strtolower($_SERVER["HTTP_USER_AGENT"]);
// 微信
$is_weixin = strripos($useragent,'micromessenger');
if($is_weixin){
//echo '微信'; exit;
echo '';
exit;
}
// iphone
$is_iphone = strripos($useragent,'iphone');
if($is_iphone){
$this->display("Codes/ios");
echo '';
exit;
}
// android
$is_android = strripos($useragent,'android');
if($is_android){
$this->display("Codes/android");
echo '';
exit;
}
// ipad
$is_ipad = strripos($useragent,'ipad');
if($is_ipad){
echo 'ipad'; exit;
}
// ipod
$is_ipod = strripos($useragent,'ipod');
if($is_ipod){
echo 'ipod'; exit;
}
// pc电脑
$is_pc = strripos($useragent,'windows nt');
if($is_pc){
echo 'pc'; exit;
}
echo 'other';
}
©著作权归作者所有:来自51CTO博客作者噼里啪啦啦的原创作品,如需转载,请注明出处,否则将追究法律责任