I know some very light PHP and decided to start from the ground up and was looking at php.net http://php.net/manual/en/tutorial.useful.php On this page, it mentions in an example how to check for IE.
<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
echo 'You are using Internet Explorer.<br />';
}
?>
I have a very small test page made up that I'm going through the section here with and this is what I have written down...
<html>
<head>
<title>PHP startup testing page</title>
</head>
<body>
<?php
echo "<p>Hello World</p>";
echo $_SERVER['HTTP_USER_AGENT']; //outputs the kind of browser the visitor is using.
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
echo 'You are using Internet Explorer.<br />';
}
?>
</body>
</html>
What I don't understand is why when I load this into Internet Explorer, the output onto my screen is Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko and the if statement thus returns nothing. Is there something very basic I'm not getting?