Home > Backend Development > PHP Tutorial > PHP identifies Android ios

PHP identifies Android ios

WBOY
Release: 2016-07-29 09:15:12
Original
1101 people have browsed it

<code><span><span><?php</span><span>if</span>(stristr(<span>$_SERVER</span>[<span>'HTTP_USER_AGENT'</span>],<span>'Android'</span>)) {

   <span>echo</span><span>'你的手机是:Android系统'</span>;

}<span>else</span><span>if</span>(stristr(<span>$_SERVER</span>[<span>'HTTP_USER_AGENT'</span>],<span>'iPhone'</span>)){

   <span>echo</span><span>'你的手机是:ISO系统'</span>;

}<span>else</span>{

   <span>echo</span><span>'你使用的是其他系统'</span>;

}
<span>?></span></span></code>
Copy after login

The above introduces PHP to identify Android and iOS, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template