Nested array filling well.. but tricky search back

thanks to your help…

I got a nice nested array

ALL_CATEGORIES = [[[1, “category1”], [2, “category2”], [3,
“category3”], [4, “category4”]], [[5, “category5”], [6, “category6”],
[7, “category7”], [8, “category8”]], [[9, “category9”], [10,
“category10”], [11, “category11”], [12, “category12”], [13,
“category13”], [14, “category14”], [15, “category15”]], [[16,
“category16”], [17, “category17”], [18, “category18”], [19,
“category19”]], [[20, “category20”], [21, “category21”], [22,
“category22”]], [[23, “category23”], [24, “category24”], [25,
“category25”], [26, “category26”], [27, “category27”], [28,
“category28”]], [[29, “category29”], [30, “category30”], [31,
“category31”]

so I can get :
all categories of first domain
ALL_CATEGORIES[0] => [[1, “category1”], [2, “category2”], [3,
“category3”], [4, “category4”]]
first category of first domain
ALL_CATEGORIES[0][0] => [1, “category1”]
category index of first category of first domain
ALL_CATEGORIES[0][0][0] => 1
category label of first category of first domain
ALL_CATEGORIES[0][0][1] => “category1”

is there any easy way to find back the domain index from the category
index ? or should I rewrite my array ?

given category index 5 then domain index would be 1
I would find it in ALL_CATEGORIES[1] => [[5, “category5”], [6,
“category6”], [7, “category7”], [8, “category8”]]

thanks fyh

joss