Use this:
<?
unset ($platform);
function browser_get_platform() {
global $platform;
return $platform;
}
if (strstr($HTTP_USER_AGENT,'Win')) {
$platform = 'Win';
} else if (strstr($HTTP_USER_AGENT,'Mac')) {
$platform = 'Mac';
} else if (strstr($HTTP_USER_AGENT,'Linux')) {
$platform = 'Linux';
} else if (strstr($HTTP_USER_AGENT,'Unix')) {
$platform = 'Unix';
} else {
$platform = 'Other';
}
if ($platform == "Mac") { Do whatever; }
else if ($platform == "Linux") { Do whatever; }
else if ($platform == "Unix") { Do whatever; }
else if ($platform == "Win") { Do whatever; }
?>