Hey there,
Im trying to detect web browsers and display the results
but then each time I tried in mozilla it appears ‘Other browsers’
in chrome it appears other browsers which is correct.
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 //EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>Date () in PHP</title>
</head>
<body>
<?php
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') )
{
$browser = 'Internet Explorer (MSIE/Compatible)';
}
else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') )
{
$browser = 'Mozilla Firefox';
}
else
{
$browser = 'Other browsers';
}
echo $browser;
?>
</body>
</html>