<?php $str = strtolower($_SERVER['HTTP_USER_AGENT']); $isPC = strpos($str, 'windows nt'); if($isPC){ echo 'd'; //执行代码 }else{ echo 's'; //执行代码 }