title: Foreach only showing last item in array
body: <p>I'm attempting to make a foreach loop to iterate over each item in an array, but it only captures the last item and does not iterate over the first one. I've stripped down the code to only show the relevant parts and added some commands to identify the problem as described above.</p>
  
  <pre><code>$message == "kk,ll";
  $myArray = explode(',', $message);
  
  print_r ($myArray);
  
  foreach ($myArray as $value);
  {   
      echo "$value &lt;br&gt;";
      $array[] = $value;
  }
  
  print_r ($array);
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>Array ( [0] =&gt; kk [1] =&gt; ll ) ll 
  Array ( [0] =&gt; ll )
  </code></pre>
  
  <p>You can see that when I use <code>print_r()</code> the array contains two items. But the <code>foreach</code> loop only loops over the last item. Adding the array elements into a new array inside the loop also ends up with an array containing only the last element. What am I doing wrong?</p>