-1

Simple question that I am struggling to find answer for. I have an array as follows:

Array (
    [0] => Array ( [0] => 2014-05-14 02:11:16 [1] => 1 ) 
    [1] => Array ( [0] => 2014-05-19 05:05:17 [1] => 76 ) 
    [2] => Array ( [0] => 2014-05-20 00:28:41 [1] => 35 ) 
    [3] => Array ( [0] => 2014-05-21 01:24:01 [1] => 25 )
)

All I need to do is count how many Arrays there are.

The answer based on the above would be 4 (0,1,2&3).

I am positive this is a very simple thing but I cannot fathom how - any and all suggestions welcomed.

4
  • 3
    And doesn't count() help? It does have a recursive option Commented Jun 5, 2014 at 18:00
  • 1
    there's 5 arrays. or do you just want to count how many there are at one particular branch of the tree? Commented Jun 5, 2014 at 18:02
  • count() on the original array should return 4 in this case. Commented Jun 5, 2014 at 18:02
  • 1
    @MarcB I dont't see 6 arrays? Commented Jun 5, 2014 at 18:04

1 Answer 1

1

Using count() should work for you :

$num = count($array);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.