This will help you to find, what kind of browser and operating system is used to view this page?
Here you can find the code please click below
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>PHP Code to find web browser and operating system</title>
</head>
<body>
<?php
$view = getenv( "HTTP_USER_AGENT" );
$browser = "An unidentified browser";
if( preg_match( "/MSIE/i", "$view" ) )
{
$browser = "Internet Explorer";
}
else if( preg_match( "/Chrome/i", "$view" ) )
{
$browser = "Chrome";
}
else if( preg_match( "/Mozilla/i", "$view" ) )
{
$browser = "Mozilla";
}
$platform = "An unidentified OS!";
if( preg_match( "/Windows/i", "$view" ) )
{
$platform = "Windows!";
}
else if ( preg_match( "/Linux/i", "$view" ) )
{
$platform = "Linux!";
}
echo("You are using $browser as browser on operating system $platform");
?>
</body>
</html>
Here you can find the code please click below
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>PHP Code to find web browser and operating system</title>
</head>
<body>
<?php
$view = getenv( "HTTP_USER_AGENT" );
$browser = "An unidentified browser";
if( preg_match( "/MSIE/i", "$view" ) )
{
$browser = "Internet Explorer";
}
else if( preg_match( "/Chrome/i", "$view" ) )
{
$browser = "Chrome";
}
else if( preg_match( "/Mozilla/i", "$view" ) )
{
$browser = "Mozilla";
}
$platform = "An unidentified OS!";
if( preg_match( "/Windows/i", "$view" ) )
{
$platform = "Windows!";
}
else if ( preg_match( "/Linux/i", "$view" ) )
{
$platform = "Linux!";
}
echo("You are using $browser as browser on operating system $platform");
?>
</body>
</html>
No comments:
Post a Comment