I have a multidimensional array like this:
$testarray = array(
array(
'First name' => 'Johnny',
'Last name' => 'Milthers',
'Age' => '24'
),
array(
'First name' => 'Toby',
'Last name' => 'Thomson',
'Age' => '25'),
),
array(
'First name' => 'Jack',
'Last name' => 'Johnson',
'Age' => '25'),
);
How do i pass search strings such as 'John', to then have the array $testarray contain only the first and last array?.
I need to pass a search term, that return the whole subarray if any of the keys values contain that string.
also if i pass "Jack Johnson", $testarray should contain only the last array.
- Is this possible, or am i going about it the wrong way? how do normal search result work for databases work?
I have been looking at a lot of stack overflow pages (and PHP manual + google), but nothing helped me out, if im posting something that already has an answer, please comment me the link.
Thank you soo much!