<?php
$agent = $_SERVER['HTTP_USER_AGENT'];
$os = false;
if(preg_match('/win/i', $agent) && preg_match('/nt 10.0/i', $agent)){
$os = 'Windows 10';
}else if (preg_match('/win/i', $agent) && preg_match('/nt 6.2/i', $agent)){
$os = 'Windows 8';
}else if (preg_match('/win/i', $agent) && preg_match('/nt 6.1/i', $agent)){
$os = 'Windows 7';
}else if (preg_match('/win/i', $agent) && preg_match('/nt 6.0/i', $agent)){
$os = 'Windows Vista';
}else if (preg_match('/win/i', $agent) && preg_match('/nt 5.1/i', $agent)){
$os = 'Windows XP';
}else if (preg_match('/win 9x/i', $agent) && strpos($
PHP:判断用户操作系统(类型最全,及时更新)
最新推荐文章于 2024-07-17 12:52:39 发布