是否有可能检测到用户来自PHP的操作系统?(Is it possible to detect what operating system a user is coming from using PHP

编程入门 行业动态 更新时间:2024-10-28 16:28:54
是否有可能检测到用户来自PHP的操作系统?(Is it possible to detect what operating system a user is coming from using PHP? (mac or windows))

比方说,我想回声“你正在使用Windows!” 或“您正在使用Macintosh!”,具体取决于用户的操作系统。 这可能吗?

Let's say for example I wanted to echo "You are using Windows!" or "You are using Macintosh!", depending on the users OS. Is this possible?

最满意答案

尝试内置于PHP中的get_browser()函数。

$browser = get_browser(null, true); echo "Platform: " . $browser["platform"] . "\n";

Try the get_browser() function that's built into PHP.

$browser = get_browser(null, true); echo "Platform: " . $browser["platform"] . "\n";

更多推荐

本文发布于:2023-07-07 04:20:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1058905.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有可能   检测到   操作系统   用户   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!