programming faqs interview questions tech technical educational freshers guide preparation interviews hr telephonic
try another color:
try another fontsize: 60% 70% 80% 90%
Programming FAQs

How to get Users Operating System ?

we can get it using $_SERVER

we can get it using $_SERVER super global array

eg: $useragent = $_SERVER['HTTP_USER_AGENT'];

if (strstr($useragent,'Win')) {
$os='Win';
} else if (strstr($useragent,'Mac')) {
$os='Mac';
} else if (strstr($useragent,'Linux')) {
$os='Linux';
} else if (strstr($useragent,'Unix')) {
$os='Unix';
} else {
$os='Other';
}