Home > Mac, Technology > Detecting OS in PHP

Detecting OS in PHP

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']


  1. No comments yet.
Submitting Comment, Give me a second...

Leave a comment

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackbacks & Pingbacks ( 0 )
  1. No trackbacks yet.