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?
By analyzing $_SERVER['HTTP_USER_AGENT']
it's possible to tell what system (and browser) the user is claiming to use.
It's easily spoofable, though.
Try the get_browser()
function that's built into PHP.
$browser = get_browser(null, true);
echo "Platform: " . $browser["platform"] . "\n";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With