如何使用PHP获得用户的屏幕分辨率 [英] how to get user's screen resolution with PHP

查看:201
本文介绍了如何使用PHP获得用户的屏幕分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
使用PHP获取屏幕分辨率

Possible Duplicate:
Getting the screen resolution using PHP

问题是自我解释

我想到达的地方

$width = ; //user screen width in here

F1! F1!

推荐答案

您需要JavaScript,而不是PHP.

You need JavaScript, not PHP.

var screenWidth = window.screen.width,
    screenHeight = window.screen.height;

然后可以通过Ajax(带有XmlHttpRequest)将其发送到服务器.

You can then send it to the server via Ajax (with an XmlHttpRequest).

另请参见 MDC window.screen文档.

See also the MDC window.screen docs.

这篇关于如何使用PHP获得用户的屏幕分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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