$agent = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/iPhone/i', $agent)){
echo "You're using Iphone";
} else if(preg_match('/Android/i', $agent)){
echo "You're using Iphone";
} else if(preg_match('/Blackberry/i', $agent)){
echo "You're using Blackberry";
}
运行手机时的想法是型号名称,例如:Iphone => 显示型号是 Iphone 4S