您好,欢迎访问一九零五行业门户网

实例详解php如何判断手机系统(附代码)

这篇文章结合实例主要介绍了php如何判断手机系统,有一定的参考价值,感兴趣的朋友可以看看,希望可以帮助到你!
现在很流行扫二维码来下载app,你知道其中的原理吗?
扫描的二维码本质是一个链接,这个链接会执行一个方法,根据不同的手机系统跳转到不同的app下载平台。
header(content-type:text/html; charset=utf-8);$user_agent = $_server['http_user_agent'];//返回手机系统、型号信息//var_dump($user_agent);if(stristr($_server['http_user_agent'],'android')){//返回值中是否有android这个关键字   //echo'你的手机是:android系统';header('location: http://xxx');}else if(stristr($_server['http_user_agent'],'iphone')){   //echo'你的手机是:ios系统';header('location: https://xxx');}else if(stristr($_server['http_user_agent'],'windowsphone')){   //echo '你使用的是windowsphone系统';header('location: http://xxx');}else{header('location: http://xxx');}
【相关教程推荐】
1. php编程从入门到精通全套视频教程 
2. php从入门到精通  
3. bootstrap教程
其它类似信息

推荐信息