<small id='HU8bJ'></small><noframes id='HU8bJ'>

  • <tfoot id='HU8bJ'></tfoot>
      <bdo id='HU8bJ'></bdo><ul id='HU8bJ'></ul>
    <legend id='HU8bJ'><style id='HU8bJ'><dir id='HU8bJ'><q id='HU8bJ'></q></dir></style></legend>
  • <i id='HU8bJ'><tr id='HU8bJ'><dt id='HU8bJ'><q id='HU8bJ'><span id='HU8bJ'><b id='HU8bJ'><form id='HU8bJ'><ins id='HU8bJ'></ins><ul id='HU8bJ'></ul><sub id='HU8bJ'></sub></form><legend id='HU8bJ'></legend><bdo id='HU8bJ'><pre id='HU8bJ'><center id='HU8bJ'></center></pre></bdo></b><th id='HU8bJ'></th></span></q></dt></tr></i><div id='HU8bJ'><tfoot id='HU8bJ'></tfoot><dl id='HU8bJ'><fieldset id='HU8bJ'></fieldset></dl></div>

      1. 检查是否从 iOS 设备访问 PHP 页面

        Check if PHP-page is accessed from an iOS device(检查是否从 iOS 设备访问 PHP 页面)
              <bdo id='U86Np'></bdo><ul id='U86Np'></ul>

              <small id='U86Np'></small><noframes id='U86Np'>

                <tbody id='U86Np'></tbody>

                <legend id='U86Np'><style id='U86Np'><dir id='U86Np'><q id='U86Np'></q></dir></style></legend>
              1. <i id='U86Np'><tr id='U86Np'><dt id='U86Np'><q id='U86Np'><span id='U86Np'><b id='U86Np'><form id='U86Np'><ins id='U86Np'></ins><ul id='U86Np'></ul><sub id='U86Np'></sub></form><legend id='U86Np'></legend><bdo id='U86Np'><pre id='U86Np'><center id='U86Np'></center></pre></bdo></b><th id='U86Np'></th></span></q></dt></tr></i><div id='U86Np'><tfoot id='U86Np'></tfoot><dl id='U86Np'><fieldset id='U86Np'></fieldset></dl></div>
              2. <tfoot id='U86Np'></tfoot>

                • 本文介绍了检查是否从 iOS 设备访问 PHP 页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个简单的 PHP 网页,希望返回不同的内容,具体取决于是从 iPhone/iPad 还是从网络浏览器访问.我该怎么做?

                  I have a simple PHP webpage, and would like to return different content depending if it's accessed from an iPhone/iPad or from a web brower. How can I do that?

                  推荐答案

                  使用 $_SERVER['HTTP_USER_AGENT'] 中的用户代理,对于简单的检测,您可以使用 this 脚本:

                  Use the user agent from $_SERVER['HTTP_USER_AGENT'], and for simple detection you can use this script:

                  <?php
                  
                  //Detect special conditions devices
                  $iPod    = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
                  $iPhone  = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
                  $iPad    = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
                  $Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
                  $webOS   = stripos($_SERVER['HTTP_USER_AGENT'],"webOS");
                  
                  //do something with this information
                  if( $iPod || $iPhone ){
                      //browser reported as an iPhone/iPod touch -- do something here
                  }else if($iPad){
                      //browser reported as an iPad -- do something here
                  }else if($Android){
                      //browser reported as an Android device -- do something here
                  }else if($webOS){
                      //browser reported as a webOS device -- do something here
                  }
                  
                  ?> 
                  

                  如果您想了解用户设备的更多详细信息,我建议使用以下解决方案之一:http://51degrees.mobi 或http://deviceatlas.com

                  If you want to know more details of the user device I recommended to use one of the following solutions: http://51degrees.mobi or http://deviceatlas.com

                  这篇关于检查是否从 iOS 设备访问 PHP 页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                • <small id='oa09G'></small><noframes id='oa09G'>

                  <legend id='oa09G'><style id='oa09G'><dir id='oa09G'><q id='oa09G'></q></dir></style></legend>
                        <tbody id='oa09G'></tbody>

                        <bdo id='oa09G'></bdo><ul id='oa09G'></ul>
                      • <tfoot id='oa09G'></tfoot>

                        <i id='oa09G'><tr id='oa09G'><dt id='oa09G'><q id='oa09G'><span id='oa09G'><b id='oa09G'><form id='oa09G'><ins id='oa09G'></ins><ul id='oa09G'></ul><sub id='oa09G'></sub></form><legend id='oa09G'></legend><bdo id='oa09G'><pre id='oa09G'><center id='oa09G'></center></pre></bdo></b><th id='oa09G'></th></span></q></dt></tr></i><div id='oa09G'><tfoot id='oa09G'></tfoot><dl id='oa09G'><fieldset id='oa09G'></fieldset></dl></div>