<?php
$userAgent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($userAgent,"iPhone") || strpos($userAgent,"iPad") || strpos($userAgent,"iPod")){
// 苹果
echo 'apple';
}else if(strpos($userAgent,"Android")){
// 安卓
echo 'Android';
} else{
// PC
echo 'pc';
}
?>