如何使用PHP获取用户的屏幕分辨率

发布于 2024-10-02 14:26:07 字数 298 浏览 0 评论 0原文

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

好吧,这个问题是不言自明的

,我想达到

$width = ; //user screen width in here

F1! F1!

Possible Duplicate:
Getting the screen resolution using PHP

well the question is self explanatory

where i want to reach is

$width = ; //user screen width in here

F1! F1!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

〃安静 2024-10-09 14:26:07

您需要 JavaScript,而不是 PHP。

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

然后,您可以通过 Ajax(使用 XmlHttpRequest)将其发送到服务器。

另请参阅 MDC window.screen 文档

You need JavaScript, not PHP.

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

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

See also the MDC window.screen docs.

迷鸟归林 2024-10-09 14:26:07

你不能,不能在 php 中。 PHP 严格来说是服务器端的。

You can't, not in php. PHP is strictly server-side.

抚你发端 2024-10-09 14:26:07

你无法在服务器端获取它,你必须使用带有innerWidth的javascript在客户端获取它。如果需要,您可以使用 AJAX 将其传递到服务器端。

you can't get it server-side, you have to get it client-side with javascript with innerWidth. you can pass it to the server-side with AJAX if you need to.

谁对谁错谁最难过 2024-10-09 14:26:07

您可以使用 JavaScript。获取用户屏幕,发送到服务器,通过php获取。

You can use JavaScript. Get the user's screen, send it to the server and get it by php.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文