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]
|