PHP判断安卓苹果Windows用户当前的操作系统

<?php
    $userAgent = $_SERVER['HTTP_USER_AGENT'];
    if(strpos($userAgent,"iPhone") || strpos($userAgent,"iPad") || strpos($userAgent,"iPod")){
        echo '苹果';
    }else if(strpos($userAgent,"Android") || strpos($userAgent,"Harmony")){
        echo '安卓';
    }else if(strpos($userAgent,"Windows") || strpos($userAgent,"Windows nt")){
        echo 'windows';
    } else {
        echo '其他';
    }
?>

 

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容