PHP OS Detection

This is an example of how to detect the OS and how to take a certain action based on it. The 3 main OS'es are windows, mac & linux.

<? 
$os 
getenv ("HTTP_USER_AGENT");
if (
strstr($os'Linux'))
{
    print(
"<b>This is a Linux computer</b>");
}
else
{
    print(
"You're not running Linux on this computer");
}
?>

[ < PHP Scripts ]


© by Sebastien Bruggeman