title: Putting an IF statement inside a foreach and missing out entry
body: <p>I have an IF statement inside a foreach loop getting data from an XML file. I then want to run through each entry in the XML file and skip putting this into a table if it doesn't meet a certain criteria. The code below is just skipping every entry and it's returning blank with nothing being put in a table.</p>
  
  <p>PHP CODE :</p>
  
  <pre><code>&lt;table width="500" border="0" cellpadding="5"&gt;
  &lt;tr&gt;
  &lt;?php
  
  $xml=simplexml_load_file("movie.xml") or die("Error: Cannot create object");
  
  foreach($xml-&gt;children() as $movie) :
  
   if($xml-&gt;sad&lt;=$_GET['happiness']
   &amp;&amp; $xml-&gt;agitated&lt;=$_GET['calmness']
   &amp;&amp; $xml-&gt;tired&lt;=$_GET['tired']
   &amp;&amp; $xml-&gt;scared&lt;=$_GET['scared'] )
   {?&gt;
     &lt;td align="center" valign="center"&gt;
     &lt;img src="&lt;?php echo $movie-&gt;path?&gt;" width="150px" alt="&lt;?php echo $movie-&gt;descrip?&gt;"/&gt;
     &lt;br /&gt;
     &lt;?php echo $movie-&gt;name ?&gt;
     &lt;/td&gt;
  &lt;?php } endforeach; ?&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>XML CODE:</p>
  
  <pre><code>&lt;movie&gt;
          &lt;name&gt;Harry Potter&lt;/name&gt;
          &lt;path&gt;images/harry.jpg&lt;/path&gt;
          &lt;sad&gt;50&lt;/sad&gt;
          &lt;agitated&gt;25&lt;/agitated&gt;
          &lt;tired&gt;50&lt;/tired&gt;
          &lt;scared&gt;75&lt;/scared&gt;
  &lt;/movie&gt;
  </code></pre>