On 8/17/05, Ing. Josué Aranda [EMAIL PROTECTED] wrote:
OK this the little function i made to solve this..
function countNested($array){
foreach($array as $value){
if(is_array($value))
$total=$this-countNested($value)+$total;
}else{
hahaha, thanks robin you save some seconds of mi life... it looks more
pro with that if...
On 8/17/05, Robin Vickery [EMAIL PROTECTED] wrote:
On 8/17/05, Ing. Josué Aranda [EMAIL PROTECTED] wrote:
OK this the little function i made to solve this..
function countNested($array){
Hi to everyone..
now i have a little problem counting an nested array. Im using it to
fill a Java TreeView... it looks like this:
[1] = Array
(
[1] = Array
(
[1] = Array
(
[1] = LECHE
Ing. Josué Aranda wrote:
Hi to everyone..
now i have a little problem counting an nested array. Im using it to
fill a Java TreeView... it looks like this:
[snip]
The number of the branches is not always the same.. (it depends on the
query).. when i use count($array, COUNT_RECURSIVE) for nested
On 8/16/05, Ing. Josué Aranda [EMAIL PROTECTED] wrote:
The number of the branches is not always the same.. (it depends on the
query).. when i use count($array, COUNT_RECURSIVE) for nested arrays..
it give to me the total including the nodes in the branches ( in this
case 28).. now here is the
OK this the little function i made to solve this..
[CODE]
function countNested($array){
foreach($array as $value){
if(is_array($value))
$total=$this-countNested($value)+$total;
}else{
$total=$total+1;
}
}
6 matches
Mail list logo