Simply

echo PHP_OS;

It will print:

For Mac: Darwin

For Windows Visat: WinNT

For Ubuntu: Linux

Also if you want to know OS details about users accessing your site, you can use

$_SERVER[‘HTTP_USER_AGENT’]


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.