Variable increments but when I use it in function, it doesn't process as I expect
<p>I have a small issue with a bit of code I use to check if a browser is IE6 or IE7, I believe the problem is something simple dealing with the <code>$browserCheck</code> variable. My intention is to have the <code>$browserCheck</code> variable increment, but for testing purposes I have the variable echo as well. I thought the problem might be that the script didn't recognize where I set the variable as a integer so is used <a href="http://php.net/manual/en/language.types.type-juggling.php" rel="nofollow">http://php.net/manual/en/language.types.type-juggling.php</a> to change the type. The site this is on is <a href="http://www.asuperiorcallcenter.com/development/" rel="nofollow">http://www.asuperiorcallcenter.com/development/</a></p>

<pre><code>&lt;?php
    $browserCheck = (int) 0;
    if (strpos($_SERVER['HTTP_USER_AGENT'],'MSIE 6') !== false) { $browserCheck++; echo $browserCheck; }
    if (strpos($_SERVER['HTTP_USER_AGENT'],'MSIE 7') !== false) { $browserCheck++; echo $browserCheck; }
    function browseRight($t)
    {
        if (($t == 'css') &amp;&amp; ($browserCheck &gt; 0))
        {
            ?&gt;
            &lt;link href='http://fonts.googleapis.com/css?family=Ubuntu|Oswald' rel='stylesheet' type='text/css'&gt;
            &lt;style type="text/css"&gt;
            #browseRight
            {
                min-width: 1000px;
                padding: 0px 100px 0px 100px;
                height: 440px;
                background: url(browseRight/bg.jpg) repeat;
                text-align: center;
            }

            #browseRight ul
            {
                width: 1000px;
            }

            #browseRight ul li
            {
                float: left;
                list-style-type: none;
                height: 310px;
                width: 180px;
                padding: 10px 10px 10px 10px;
            }

                #browseRight ul li:hover
                {
                    background: #eee7d5;
                }

            #browseRight ul li img
            {
                height: 130px;
                clear: both;
            }

            #browseRight h2
            {
                font-family: 'Oswald', sans-serif;
                width: 100%;
                clear: both;
                font-size: 20px;
                padding: 20px 0px 0px 0px;
                color: #333333;
            }

            #browseRight ul li h2
            {
                font-family: 'Oswald', sans-serif;
                width: 100%;
                clear: both;
                font-size: 16px;
                color: #333333;
            }

            #browseRight p
            {
                font-family: 'Ubuntu', sans-serif;
                font-size: 12px;
                color: #333333;
                text-align: center;
                overflow: hidden;
            }

            #browseRight ul li p
            {
                height: 80px;
            }
            &lt;/style&gt;
            &lt;?php
        }
        if (($t == 'html') &amp;&amp; ($browserCheck &gt; 0))
        {
            ?&gt;
                &lt;div align="center"&gt;&lt;div id="browseRight"&gt;
                &lt;h2&gt;Your Browser is out of date.&lt;/h2&gt;
                &lt;p&gt;Does the website below look bad? if so it is because your browser is out of date. Fortunately you can fix this, it is as easy as updating your web browser. Below are the most popular web browsers around, visit thier websites and update to a new browser.&lt;/p&gt;
                &lt;div align="center"&gt;&lt;ul&gt;
                    &lt;a href="http://www.google.com/chrome/" target="_blank"&gt;&lt;li&gt;&lt;img src="browseRight/google-chrome-logo.png"&gt;&lt;h2&gt;Google Chrome&lt;/h2&gt;&lt;p&gt;Get a fast, free web browser&lt;/p&gt;&lt;/li&gt;&lt;/a&gt;
                    &lt;a href="http://www.mozilla.org/en-US/" target="_blank"&gt;&lt;li&gt;&lt;img src="browseRight/mozilla-firefox-logo.png"&gt;&lt;h2&gt;Mozilla Firefox&lt;/h2&gt;&lt;p&gt;We are mozilla. Non-profit, for the good of the Web&lt;/p&gt;&lt;/li&gt;&lt;/a&gt;
                    &lt;a href="http://www.apple.com/safari/" target="_blank"&gt;&lt;li&gt;&lt;img src="browseRight/safari-logo.png"&gt;&lt;h2&gt;Safari&lt;/h2&gt;&lt;p&gt;Opera Software has always strived to develop the fastest and technologically most advanced browsers.&lt;/p&gt;&lt;/li&gt;&lt;/a&gt;
                    &lt;a href="http://www.opera.com/" target="_blank"&gt;&lt;li&gt;&lt;img src="browseRight/opera-logo.png"&gt;&lt;h2&gt;Opera&lt;/h2&gt;&lt;p&gt;It’s a browser. It’s a platform. It’s an open invitation to innovate. Safari sets the standard for the way browsing should be.&lt;/p&gt;&lt;/li&gt;&lt;/a&gt;
                    &lt;a href="http://windows.microsoft.com/en-us/internet-explorer/products/ie/home" target="_blank"&gt;&lt;li&gt;&lt;img src="browseRight/internet-explorer-logo.png"&gt;&lt;h2&gt;Internet Explorer&lt;/h2&gt;&lt;p&gt;A more beautiful web&lt;/p&gt;&lt;/li&gt;&lt;/a&gt;
                &lt;/ul&gt;&lt;/div&gt;
                &lt;/div&gt;&lt;/div&gt;
            &lt;?php
        }
    }
?&gt;
</code></pre>
