I have an associative array and wanted to check if an array is in that associative array, If yes, I want to get the matching array.
My associative array look something like this:
$assoc_array = array(
array(
'firstname' => 'John',
'lastname' => 'Doe',
'age' => 26
),
array(
'firstname' => 'Sophia',
'lastname' => 'Smith',
'age' => 30
)
);
Then if I want to check this array:
$array = array(
'firstname' => 'John',
'lastname' => 'Doe'
);
It would give me this result:
array(
'firstname' => 'John',
'lastname' => 'Doe',
'age' => 26
);
Any help would be greatly appreciated.