PHP IF Statement not working - variable does contain correct data, however
<p>I am trying to use an IF statement to check if a variable contains a piece of text, if so, echo yes, if not, echo no. Simple I know, but it does not seem to be working for me. I am very new to PHP, so any replies should be understandable for a monkey! :P</p>

<p>Here is my code. Bear in mind I am working with PHP simple html dom. </p>

<pre><code>&lt;?php
include 'simple_html_dom.php'; 
$html = file_get_html('http://www.amazon.co.uk/New-Apple-iPod-touch-Generation/dp/B0040GIZTI/ref=br_lf_m_1000333483_1_1_img?ie=UTF8&amp;s=electronics&amp;pf_rd_p=229345967&amp;pf_rd_s=center-3&amp;pf_rd_t=1401&amp;pf_rd_i=1000333483&amp;pf_rd_m=A3P5ROKL5A1OLE&amp;pf_rd_r=1ZW9HJW2KN2C2MTRJH60');
$stock_data = $html-&gt;find('span[class=availGreen]',0); 

if ( $stock_data == "In stock." ) {
  echo "Yes";
} 
echo "No";

?&gt;
</code></pre>

<p>Now I have tested if the variable did contain the text, using echo $stock_data; it prints the correct text, however the if statement still comes back and echo's No.</p>

<p>Any help, apologies if this is something so simple. </p>
