it looks deceptively good at first for count.
count($arr_countable_items) will count all the first dimension arrays,
with the recursive param it seems it will count every element in every array.
also if the array is an index array and not precisely indexed 0, 1, 2, 3, ...., the count will fail
Peter
-------- Original Message --------
Subject: Re: [nyphp-talk] Array-cersize
From: David Krings <ram...@gmx.net>
Date: Fri, October 22, 2010 4:24 am
To: NYPHP Talk <talk@lists.nyphp.org>
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
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation