我有一个如下所示的数组:
Array (
[0] => Array (
[slideID] => 3
[parentSlideID] => 1
[subSlideOrder] => 1
[headline] =>
[copy] =>
[colourID] => 0
[URL] => 2.jpg
[category] => 1
[visible] => 1
[slideOrder] => 2
[type] => 0 )
[1] => Array (
[slideID] => 3
[parentSlideID] => 1
[subSlideOrder] => 1
[headline] =>
[copy] =>
[colourID] => 0
[URL] => 2.jpg
[category] => 1
[visible] => 1
[slideOrder] => 2
[type] => 0 )
[2] => Array (
[slideID] => 3
[parentSlideID] => 0
[subSlideOrder] => 1
[headline] =>
[copy] =>
[colourID] => 0
[URL] => 2.jpg
[category] => 1
[visible] => 1
[slideOrder] => 2
[type] => 0 )
)
如何搜索数组,以便检查parentSlideID
每个子数组中的值,然后返回找到匹配项的键。
例如,在数组中搜索“1”将返回0,1
. 搜索“0”将返回2
。搜索“3”不会返回任何内容。这可能吗?