NYCPHP Meetup

NYPHP.org

[nycphp-talk] Array-cersize

David Krings ramons at gmx.net
Fri Oct 22 07:24:18 EDT 2010


On 10/21/2010 22:26, Peter Sawczynec wrote:
> What is the proper best way for me to count how many (if any) b_arrays are in
> $arr_countable_items.



>
> What is the best way to count how many value1s (if any) are in
> $arr_countable_items_2.


Hi!

Doesn't count() do what you need to do? Without paramter it gives you the 
count of the elements in the array, with the parameter COUNT_RECURSIVE it will 
give you the count including the sub-arrays. See here: 
http://www.php.net/manual/en/function.count.php

David



More information about the talk mailing list