我有一个存储在$data
中的ldap搜索的多维数组:
Array
(
[count] => 1
[0] => Array
(
[objectclass] => Array
(
[count] => 3
[0] => top
[1] => posixGroup
[2] => sambaGroupMapping
)
[0] => objectclass
[cn] => Array
(
[count] => 1
[0] => xxxxx
)
[1] => cn
[gidnumber] => Array
(
[count] => 1
[0] => xxxx
)
[2] => gidnumber
[sambasid] => Array
(
[count] => 1
[0] => xxxx
)
[3] => sambasid
[sambagrouptype] => Array
(
[count] => 1
[0] => 2
)
[4] => sambagrouptype
[displayname] => Array
(
[count] => 1
[0] => xxxx
)
[5] => displayname
[memberuid] => Array
(
[count] => 2
[0] => xxxxx
[1] => xxxxx
)
[6] => memberuid
[count] => 7
[dn] => cn=xx,ou=xx,dc=xx,dc=xx
)
)
我想提取memberuid的计数:[count] => 2
但我无法正确执行此操作。我无法搞清楚结构......
我试过:$data[0]['displayname']['memberuid']['count']
给了我一个Illegal string offset
感谢您的帮助