title: php foreach echo prints "Array" as value
body: <p>Perhaps I'm simply having trouble understanding how php handles arrays.  </p>
  
  <p>I'm trying to print out an array using a foreach loop.  All I can seem to get out of it is the word "Array".</p>
  
  <pre><code>&lt;?php 
      $someArray[]=array('1','2','3','4','5','6','7'); // size 7
      foreach($someArray as $value){ 
          echo $value;    
  ?&gt; 
  
  &lt;br /&gt;
  
  &lt;?php
      }
  ?&gt;
  </code></pre>
  
  <p>This prints out this:</p>
  
  <pre><code>Array
  </code></pre>
  
  <p>I'm having trouble understanding why this would be the case.  If I define an array up front like above, it'll print "Array".  It almost seems like I have to manually define everything... which means I must be doing something wrong.  </p>
  
  <p>This works:</p>
  
  <pre><code>&lt;?php 
      $someArray[0] = '1';
      $someArray[1] = '2';
      $someArray[2] = '3';
      $someArray[3] = '4';
      $someArray[4] = '5';
      $someArray[5] = '6';
      $someArray[6] = '7';
  
      for($i=0; $i&lt;7; $i++){
          echo $someArray[$i]."&lt;br /&gt;";
      }
  ?&gt;
  </code></pre>
  
  <p>Why won't the foreach work?</p>
  
  <p>here's a link to see it in action >> <a href="http://phpclass.hylianux.com/test.php" rel="noreferrer">http://phpclass.hylianux.com/test.php</a> </p>