Home  >  Article  >  php教程  >  PHP determines whether the client is IOS or Android

PHP determines whether the client is IOS or Android

大家讲道理
大家讲道理Original
2016-11-11 09:40:001736browse

<?php
if(strpos($_SERVER[&#39;HTTP_USER_AGENT&#39;], &#39;iPhone&#39;)||strpos($_SERVER[&#39;HTTP_USER_AGENT&#39;], &#39;iPad&#39;)){
    echo &#39;systerm is IOS&#39;;
}else if(strpos($_SERVER[&#39;HTTP_USER_AGENT&#39;], &#39;Android&#39;)){
    echo &#39;systerm is Android&#39;;
}else{
    echo &#39;systerm is other&#39;;
}
?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn