标签: php
$needle = 'foo'; $haystack = [ 'bar' => [ 'foo' ], 'baz' => [ 'qux' ] ]; // if 'foo' in of the arrays of $haystack, return its key // in this case its 'bar'
array_search似乎适用于简单数组。我的情况需要什么?
array_search
答案 0 :(得分:2)
希望这个最简单的会有所帮助
Try this code snippet here
{{1}}