title: In PHP why it's only echo the last item And I know In the Array it's More than One
body: <p>I Have to test <code>$_POST</code> before adding it to the database so if any input is empty it will print it but when I submit all items empty it's only print the item in the array? what the problem this My code? </p>
  
  <pre><code>$formerror = array ();
  
  if(empty($depdesc))
  {
      $formerror [] = " وصف القسم لا يمكن ان يكون فارغ  ";
  }
  if(empty($depName))
  {
      $formerror [] = " اسم القسم لا يمكن ان يكون فارغ  ";
  }
  #End of check if any empty item 
  if(empty($formerror))
  {
      echo " No error ";
  }else
  {
      foreach($formerror as $error);
      {
  
          echo $error;
      }
  }   
  </code></pre>