Hello, I am new to PHP, I have a script that detects the browser name and the operating system. I found this script somewhere. What it does though is says, you are using Internet explorer on Windows for example. However it would be nice if I could get it to say You are using INTERNET EXPLORER (VERSION NUMBER) on WINDOWS (VERSION). is this possible to do. ? Here is the script..
<?php
$viewer = getenv("HTTP_USER_AGENT");
$browser = "an unidentified browser";
if( preg_match( "/MSIE/i", "$viewer")){ $browser = "Internet Explorer"; }
else if( preg_match( "/Netscape/i", "$viewer"))
{ $browser = "Netscape"; }
else if( preg_match( "/Opera/i", "$viewer"))
{ $browser = "Opera"; }
$platform = "an unidentified operating system";
if( preg_match( "/Windows/i", "$viewer"))
{ $platform = "Windows"; }
else if( preg_match( "/Linux/i", "$viewer"))
{ $platform = "Linux"; }
echo("You're using $browser on $platform");
?>