如何使用PHP检测Mobile Safari服务器端? [英] How do I detect Mobile Safari server side using PHP?

查看:95
本文介绍了如何使用PHP检测Mobile Safari服务器端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mobile Safari是一款功能非常强大的浏览器,它可以完美地处理我的网站。但是,我的页面上有一些元素可以针对使用此设备进行浏览进行优化;例如,提供比桌面版本更小的特定缩略图,以帮助将更多内容放入屏幕。

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 using this device; such as serving specific thumbnails that are smaller than the desktop counterparts to help fit more content into the screen.

我想知道如何检测Mobile Safari(所有版本) ,最好)使用PHP,这样我就可以服务a)一个特定的css文件和b)不同大小的图像缩略图。

I would like to know how I can detect Mobile Safari (all versions, preferably) using PHP, so then I can serve a) a specific css file and b) different sized image thumbnails.

推荐答案

将用户代理字符串与Safari Mobile使用的字符串进行比较:

Compare the user agent string with the one of a Safari Mobile uses:

Safari Mobile用户代理字符串

这篇关于如何使用PHP检测Mobile Safari服务器端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆