<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
<title>PHP Example</title>
</head>
<body>


<?php
if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) {
?>
    <h3>The check of <code>$_SERVER["HTTP_USER_AGENT"]</code> must have returned true</h3>
    <b>You are using Internet Explorer</b>
<?php
} else {
?>
    <h3>The check of <code>$_SERVER["HTTP_USER_AGENT"]</code> must have returned false</h3>
    <b>You are not using Internet Explorer</b>
<?php
}
?>

<h3>Explanation</h3>

<p>Instead of using a PHP echo statement to output something, we 
jumped out of PHP mode and just sent straight HTML. The 
important and powerful point to note here is that the logical 
flow of the script remains intact. Only one of the HTML blocks 
will end up getting sent to the viewer depending on if strstr() 
returned TRUE or FALSE In other words, if the string MSIE was 
found or not.</p>

</body>
</html>