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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:44:141064browse

在线等,网页如何判断客户端是安卓还是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';	}}

Statement:
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