title: selecting specific element from a nested array using php foreach
body: <p>let say I have this nested array:</p>
  
  <pre><code>    Array
  (
      [0] =&gt; page
      [1] =&gt; section
      [2] =&gt; side
      [3] =&gt; Array
          (
              [0] =&gt; Array
                  (
                      [0] =&gt; url1
                      [1] =&gt; url2
                      [2] =&gt; url3
                  )
  
              [1] =&gt; Array
                  (
                      [0] =&gt; url4
                      [1] =&gt; url5
                      [2] =&gt; url6
                  )
  
              [2] =&gt; Array
                  (
                      [0] =&gt; url7
                      [1] =&gt; url8
                      [2] =&gt; url9
                  )
  
          )
  
  )
  </code></pre>
  
  <p>I want to foreach (php) to get from each array element with index[1]</p>
  
  <pre><code>foreach($arr as $key =&gt; $value){
          echo $key." : ".$value."\n";
  
  foreach($value as $key =&gt; $value){
      echo "   ". $key." : ".$value."\n";
  
      foreach($value as $key =&gt; $value){
          echo "     ". $key." : ".$value."\n";
      }
  }
  }
  </code></pre>
  
  <p>and this is my output:</p>
  
  <pre><code>0 : page
  1 : section
  2 : side
  3 : Array
     0 : Array
       0 : url1
       1 : url2
       2 : url3
     1 : Array
       0 : url4
       1 : url5
       2 : url6
     2 : Array
       0 : url7
       1 : url8
       2 : url9
  </code></pre>
  
  <p>but I want to select specific element from each array at the same time some thing like this:</p>
  
  <pre><code> 1 : url2
   1 : url5
   1 : url8
  </code></pre>
  
  <p>Can anyone help?</p>