How do I detect Mobile Safari server side using PHP?

后端 未结 6 1916
深忆病人
深忆病人 2020-12-19 04:32

Mobile Safari is a very capable browser, and it can handle my website as it is perfectly. However, there are a few elements on my page that could be optimized for browsing u

6条回答
  •  情书的邮戳
    2020-12-19 05:03

    $_SERVER['HTTP_USER_AGENT']  
    

    That will give you the user-agent string back which you can compare to mobile safari.

    p.s. http://wurfl.sourceforge.net/ WURFL may help you determine which UAs you want.

提交回复
热议问题