基于搜索值部分匹配的多维数组筛选
2022-08-30 14:13:40
我正在寻找一个给定此数组的函数:
array(
[0] =>
array(
['text'] =>'I like Apples'
['id'] =>'102923'
)
[1] =>
array(
['text'] =>'I like Apples and Bread'
['id'] =>'283923'
)
[2] =>
array(
['text'] =>'I like Apples, Bread, and Cheese'
['id'] =>'3384823'
)
[3] =>
array(
['text'] =>'I like Green Eggs and Ham'
['id'] =>'4473873'
)
etc..
我想搜索针头
“面包”
并得到以下结果
[1] =>
array(
['text'] =>'I like Apples and Bread'
['id'] =>'283923'
)
[2] =>
array(
['text'] =>'I like Apples, Bread, and Cheese'
['id'] =>'3384823'