Home > Backend Development > PHP Tutorial > 在线等,网页如何判断客户端是安卓还是IOS系统?

在线等,网页如何判断客户端是安卓还是IOS系统?

WBOY
Release: 2016-06-23 13:44:14
Original
1042 people have browsed it

在线等,网页如何判断客户端是安卓还是IOS系统?,好根据不同的系统打开不同的软件。现在能打开软件了,安卓、IOS都能打开了。但是如何判断当前机型 是安卓还是IOS?


回复讨论(解决方案)

可通?HTTP_USER_AGENT?判?。

function getUserAgent(){	$agent = $_SERVER['HTTP_USER_AGENT'];	if(stripos($agent,'iPod')!==false||stripos($agent,'iPhone')!==false||stripos($agent,'iPad')!==false){		return 'iOS';	}elseif(stripos($agent,'Android')!==false){}		return 'Android';	}else{		return 'other';	}}
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template