如何动态获取类别级数。这是一个PHP数组,当用户改变菜单结构时,这可能会改变,但目前这是一个结构,我只是想知道邮件类别和主类别中多少级别的子类别是“品牌”。这是我的数组结构。如何通过多维数组获取类别级别php
[1] => Array
(
[name] => 01e3f447-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 01e3f447-4b81-11e7-a858-b8763f541038
[category] => Brands
[slug] => brands
[description] =>
[image] =>
[parentCategory] =>
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 14:58:31
)
[children] => Array
(
[0] => Array
(
[name] => 0ded5b28-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 0ded5b28-4b81-11e7-a858-b8763f541038
[category] => Apparel
[slug] => apparel
[description] =>
[image] =>
[parentCategory] => 01e3f447-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 14:58:51
)
[children] => Array
(
[0] => Array
(
[name] => 3681265e-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 3681265e-4b81-11e7-a858-b8763f541038
[category] => Adidas
[slug] => adidas
[description] =>
[image] =>
[parentCategory] => 0ded5b28-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 14:59:59
)
[children] =>
)
[1] => Array
(
[name] => 3f211015-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 3f211015-4b81-11e7-a858-b8763f541038
[category] => Columbia
[slug] => columbia
[description] =>
[image] =>
[parentCategory] => 0ded5b28-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 15:00:14
)
[children] =>
)
)
)
[1] => Array
(
[name] => 1988d10a-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 1988d10a-4b81-11e7-a858-b8763f541038
[category] => Footwear
[slug] => footwear
[description] =>
[image] =>
[parentCategory] => 01e3f447-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 14:59:11
)
[children] => Array
(
[0] => Array
(
[name] => 49becbc8-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 49becbc8-4b81-11e7-a858-b8763f541038
[category] => Polo
[slug] => polo
[description] =>
[image] =>
[parentCategory] => 1988d10a-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 15:00:31
)
[children] =>
)
[1] => Array
(
[name] => 4e647bee-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 4e647bee-4b81-11e7-a858-b8763f541038
[category] => Nike
[slug] => nike
[description] =>
[image] =>
[parentCategory] => 1988d10a-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 15:00:39
)
[children] =>
)
)
)
)
)
你的问题不明确正是你期待什么。 – kazinayem2011
看看我的阵列结构,你会看到主阵列是品牌和水平是(1)和内部品牌 - >服装哪些级别是(2)和内部品牌 - >服装 - >阿迪达斯哪个级别是(3)这是我究竟想要什么。我想知道邮件类别中的子类别的级别。 –