title: Counting rows/records in a multidimensional array
body: <p>I have a set of nested arrays.</p>
  
  <p>[data] is the top level array.</p>
  
  <p>The lower level arrays are all  identified by incremental numbers, dynamically assigned...essentially each sub-array identifies a row/record of information.</p>
  
  <p>How would I extract the count of the sub-arrays?  I need to be able to do this to post this data into a DB.</p>
  
  <p>The number of sub-arrays is dynamic, and can change depending on what data I am parsing through.</p>
  
  <pre><code> [data] =&gt; Array
          (
              [0] =&gt; Array
                  (
                      [id] =&gt; 3475
                      [name] =&gt; Player1
                      [score] =&gt; 11870
                      [rank] =&gt; 213
                      [total_cities] =&gt; 2
                      [crown] =&gt; None
                      [alliance_id] =&gt; 134
                      [title] =&gt; Earl
                      [fame_total] =&gt; 509875
                      [fame_rank] =&gt; 381
                      [defeated_total] =&gt; 3436
                      [defeated_rank] =&gt; 376
                      [plunder_total] =&gt; 1388754
                      [plunder_rank] =&gt; 245
                  )
  
              [1] =&gt; Array
                  (
                      [id] =&gt; 3523
                      [name] =&gt; Player2
                      [score] =&gt; 1978
                      [rank] =&gt; 281
                      [total_cities] =&gt; 1
                      [crown] =&gt; None
                      [alliance_id] =&gt; 134
                      [title] =&gt; Baron
                      [fame_total] =&gt; 0
                      [fame_rank] =&gt; 448
                      [defeated_total] =&gt; 0
                      [defeated_rank] =&gt; 448
                      [plunder_total] =&gt; 0
                      [plunder_rank] =&gt; 436
                  )
  
              [2] =&gt; Array
                  (
                      [id] =&gt; 73
                      [name] =&gt; Player3
                      [score] =&gt; 1308
                      [rank] =&gt; 304
                      [total_cities] =&gt; 1
                      [crown] =&gt; None
                      [alliance_id] =&gt; 134
                      [title] =&gt; Marquess
                      [fame_total] =&gt; 5604153
                      [fame_rank] =&gt; 237
                      [defeated_total] =&gt; 37270
                      [defeated_rank] =&gt; 229
                      [plunder_total] =&gt; 68130
                      [plunder_rank] =&gt; 335
                  )
  </code></pre>