Or statement in PHP
<p>I want to add an ID to a span element if the page is either 'a' or 'b'.</p>

<p>My code so far is this:</p>

<pre><code>&lt;span class="subnav2" &lt;? if(($page == 'a') || ($page == 'b')): ?&gt; id="active"&lt;? endif ?&gt;&gt;
</code></pre>

<p>but it only adds the class to the span when 'a' is true. What am I doing wrong?</p>

<p>The value of $page is:</p>

<pre><code>&lt;? 
    $path = basename($_SERVER['PHP_SELF']);
    $page = basename($path);
    $page = basename($path, '.php');
    $page = str_replace('_',' ',$page);
    $page = str_replace('.php','',$page);
    $page = ucfirst($page);
?&gt;
</code></pre>
