Home > php教程 > PHP源码 > body text

PHP determines whether the client is IOS or Android

大家讲道理
Release: 2016-11-11 09:40:00
Original
1744 people have browsed it

<?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;;
}
?>
Copy after login

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template