title: php count even numbers in an array
body: <p>So I am trying to learn php, and the code for finding even numbers doesn't output anything, but I can't seem to find the error, can anybody find where I have made my stupid mistake? Here is the code: </p>
  
  <pre><code>&lt;?php
  
  /*this sets the array up with the data*/
  
  $myarray = array(1,2,3,4,5,6,7,8,9,10);
  
  /* this is the count to get the total number from my array */
  
  $total = count($myarray);
  ?&gt;
  
  &lt;h1&gt;Display all even numbers&lt;/h1&gt;
  &lt;ul&gt;
  &lt;?php for ($i=1; $i &lt; total; $i += 2): ?&gt;
  &lt;li&gt;The array element value is &lt;?php echo $myarray[$i]; ?&gt;. &lt;/li&gt;
  &lt;?php endfor; ?&gt;
  
  &lt;/ul&gt;
  </code></pre>
  
  <p>Thanks and if nobody wants to post an answer I understand new questions are frustrating. </p>
  
  <p>thanks</p>