Quantcast
Channel: User Chamilyan - Stack Overflow
Viewing all articles
Browse latest Browse all 43

Filter multidimensional array based on partial match of search value

$
0
0

I'm looking for a function where given this array:

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.. 

I want to search for the needle

"Bread"

and get the following result

[1] =>  array(   ['text'] =>'I like Apples and Bread'   ['id'] =>'283923' ) [2] =>  array(  ['text'] =>'I like Apples, Bread, and Cheese'  ['id'] =>'3384823'

Viewing all articles
Browse latest Browse all 43

Latest Images

Trending Articles





Latest Images