作者:我是一颗菠菜 | 来源:互联网 | 2017-05-13 02:18
function equipmentSystem(){
$agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
if(stristr($agent,'iPad')) {
$fb_fs = "iPad";
}else if(preg_match('/Android (([0-9_.]{1,3})+)/i',$agent,$version)) {
$fb_fs = "手机(Android ".$version[1].")";
}else if(stristr($agent,'Linux')){
$fb_fs = "电脑(Linux)";
}else if(preg_match('/iPhone OS (([0-9_.]{1,3})+)/i',$agent,$version)){
$fb_fs = "手机(iPhone ".$version[1].")";
}else if(preg_match('/Mac OS X (([0-9_.]{1,5})+)/i',$agent,$version)){
$fb_fs = "电脑(OS X ".$version[1].")";
}else if(preg_match('/unix/i',$agent)){
$fb_fs = "Unix";
}else if(preg_match('/windows/i',$agent)){
$fb_fs = "电脑(Windows)";
}else{
$fb_fs = "未知(Unknown)";
}return $fb_fs;}
以上就介绍了获取用户登录的设备类型 系统+版本号,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。