当前位置 : 主页 > 网络编程 > PHP >

PHP 判断客户端是IOS还是Android

来源:互联网 收集:自由互联 发布时间:2021-07-03
?phpif(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){ echo 'systerm is IOS';}else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){ echo 'systerm is Android';}else{ echo 'systerm is other';}?
<?php
if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
    echo 'systerm is IOS';
}else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
    echo 'systerm is Android';
}else{
    echo 'systerm is other';
}
?>
网友评论