You are here: Finding key level in mutidimensional array « PHP Programming Language « IT news, forums, messages
Finding key level in mutidimensional array

Posted by Manish on 08/09/06 04:44

This is the print_r() for a variable $categories.

$categories ::

Array
(
[1003] => Array
(
[1014] => Array
(
[1006] => Array
(
[1018] => 0
[1019] => 0
)

[1015] => Array
(
[1017] => 0
[1016] => 0
)

)

[1008] => Array
(
[1005] => 0
)

)

[1004] => Array
(
[1020] => 0
)
)

Any key in the array at any level is unique. i.e. key 1003 will not
appear twice.

I want to find out at what level the particular key exists.

Thats,

KeyLevel(1003) = 1
KeyLevel(1008) = 2
KeyLevel(1016) = 4

Please suggest on the coding for function KeyLevel().

Thanks.

Manish

 

Navigation:

[Reply to this 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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация