title: PHP - How do I access specific array values in nested array?
body: <p>I have an array like this:</p>
  
  <pre><code>    Array (
      [0] =&gt; Array ( 
          [0] =&gt; 510 
          [1] =&gt; 984 
          [2] =&gt; 1045 
          [3] =&gt; 2068 
          [4] =&gt; 1054 
          [5] =&gt; 673 
          ) 
      [1] =&gt; Array ( 
          [0] =&gt; 1163 
          [1] =&gt; 1982 
          [2] =&gt; 2067 
          [3] =&gt; 3989 
          [4] =&gt; 1940 
          [5] =&gt; 1242 
          ) 
      [2] =&gt; Array ( 
          [0] =&gt; june 
          [1] =&gt; july 
          [2] =&gt; august 
          [3] =&gt; september 
          [4] =&gt; october 
          [5] =&gt; november 
          ) 
      )
  </code></pre>
  
  <p>I want to access only one of the arrays within the array at a time and echo them out.  </p>
  
  <p>For example, I would get: 510, 984, 1045, 2068, 1054, and 673 as one result.</p>
  
  <p>I've looked at multiple threads and answers but nothing that quite solves my issue, I've been able to print out all the values but I just want some specifically.</p>
  
  <p>I'd store it in the variable: <code>$array_item</code></p>
  
  <p>My most recent attempt was:</p>
  
  <pre><code>foreach ($array_item as $inner) {
  if (is_array($inner)) {
      foreach ($inner[0] as $value) {
          echo "$value \n";
      }
  }
  }
  </code></pre>
  
  <p>Which gives me: Warning: Invalid argument supplied for foreach().</p>
  
  <p>I thought for sure that would work, what am I doing wrong?</p>