是否有可能检测到用户来自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";更多推荐
发布评论