title: PHP - Accessing Multidimensional Array Values
body: <p>After several hours of messing, sweating and pulling my hair out I'm still unable to access these values. I want to loop through the first level of arrays, and that's simple enough with a basic 'foreach' loop but I can't seem to get to the '['suitability']' array on the second sub array. I've looked around but can't seem to get anything other than really basic array tutorials which don't seem to delve to far into looping.</p>
  
  <p>I'm trying to access the values in the nested/sub array ie '['Species_name']'.</p>
  
  <p>I don't want to use associative keys as the sorting is a bit of an issue.</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 1
              [name] =&gt; Bradeley Hall Pool
              [postcode] =&gt; CW1 5QN
              [lat] =&gt; 53.10213
              [lon] =&gt; -2.41069
              [size] =&gt; 1.60
              [pegs] =&gt; 21
              [distance] =&gt; 26.6
          )
  
      [1] =&gt; Array
          (
              [id] =&gt; 2
              [name] =&gt; Farm Pool
              [postcode] =&gt; CW9 6JQ
              [lat] =&gt; 53.320502
              [lon] =&gt; -2.549049
              [size] =&gt; 0.88
              [pegs] =&gt; 8
              [distance] =&gt; 15.4
              [suitability] =&gt; Array
                  (
                      [0] =&gt; Array
                          (
                              [fk_water_id] =&gt; 2
                              [fk_species_id] =&gt; 4
                              [species_name] =&gt; Barbel
                              [species_rating] =&gt; 1
                              [record_id] =&gt; 1
                              [weight_kg] =&gt; 2.721554
                              [length_cm] =&gt; 40
                              [height_cm] =&gt; 30
                          )
                  )
         )
  )
  </code></pre>