Last if statement always evaluating to true (overwriting)?
<p>I'm trying to display an image based on a change in rank. If the values of the array <code>$rank_change</code> are echoed before my if statements, the correct values are printed, such as:</p>

<pre><code>0, 0, 0, 0, 0, 0, 0, -7, 1, 1, 1, 1, 1, 1, 1 
</code></pre>

<p>However, if printed after the following if statements, <code>side.gif</code> is always shown:</p>

<pre><code>if($rank_change[$i] &gt; 0) { $rank_change[$i] = "&lt;img src=\"up.gif\" width=\"16\" height=\"16\"/&gt;"; }
if($rank_change[$i] &lt; 0) { $rank_change[$i] = "&lt;img src=\"down.gif\" width=\"16\" height=\"16\"/&gt;"; }
if($rank_change[$i] == 0) { $rank_change[$i] = "&lt;img src=\"side.gif\" width=\"16\" height=\"16\"/&gt;";}
</code></pre>

<p>In the cases where the value of <code>$rank_change</code> are 7 and 1, why does the last statement still evaluate to true?</p>

<p>I realize it would be more efficient to use <code>switch($rank_change[$i])</code> but, I still don't understand why the final if statement is evaluating true on all values.</p>

<p>Any help would be greatly appreciated!</p>
