Reply to counting nested array

Your name:

Reply:


Posted by Ing. Josuι Aranda on 08/16/05 18:30

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 PREMIUM 1 LT
[2] => LECHE PREMIUM 1/2 GL
[3] => LECHE PREMIUM 1 GL
)

[2] => Array
(
[1] => LECHE LIGHT 1 LT
[2] => LECHE LIGHT 1/2 GL
[3] => LECHE FRESCA 1 GL LIGHT
)

[3] => Array
(
[1] => LECHE SEMI 1 LT FRESCA
[2] => LECHE DESLACTOSADA 21 DIAS 1 LT
[3] => LECHE SILUETTE 21 DIAS 1 LT
[4] => LECHE DESARROLLO 21 DIAS 1 LT
[5] => LECHE ENTERA 21 DIAS 1 LT
[6] => LECHE LIGHT 21 DIAS 1 LT
)

[5] => Array
(
[1] => LECHE FRESCA 1 GL SEMIDESCREMADA BELL
[2] => LECHE FRESCA 1/2 GL SEMIDESCREMADA BELL
)

[6] => Array
(
[1] => LECHE FRESCA 1 GL LIGHT BELL
[2] => LECHE FRESCA 1/2 GL LIGHT BELL
[3] => LECHE FRESCA 1 LT LIGHT BELL
)

[7] => Array
(
[1] => LECHE FRESCA 1 GL ENTERA BELL
[2] => LECHE FRESCA 1/2 GL ENTERA BELL
[3] => LECHE FRESCA 1LT ENTERA BELL
)

)


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 question, how i can get only the last nodes
in this case ... exist a easy way to do it?. or its necessary to make
a funcion with a bunch of foreach?.. any suggestions are welcome =o)
thanks!
--
____________________

JOSUE ARANDA>>>

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация