我正在尝试在 2 层数组的底层部分中搜索子字符串,并从顶层返回密钥。例如,在下面的数组中在“A”中搜索“ca”将返回“0”和“2”(但会错过“cattle”):
Array (
[0] => Array (
[A] => cat
[B] => horses
)
[1] => Array (
[A] => dog
[B] => cattle
)
[2] => Array (
[A] => cat
[B] => sheep
)
)