PHP executing header:location regardless IF statement parameters
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2063480/the-3-different-equals">The 3 different equals</a>  </p>
</blockquote>



<p>Can anyone tell me why, when using the code below, I am getting redirected to elephant.com rather than seeing a 'giraffe!</p>

<pre><code>&lt;?php
$foo="giraffe";
if($foo="elephant"){
header("location:http://www.elephant.com");
exit();
}else{
 echo $foo;}
?&gt;
</code></pre>

<p>Thanks for looking</p>

<p>J</p>
