I have a multi dimensional array and i want to use php array_search to find the key for where 2 key values match. below is my array.
$array[] = [
'id' => 2,
'title' => 'product 2',
'size' => 2
];
$array[] = [
'id' => 2,
'title' => 'product 2',
'size' => 1
];
$key = array_search(2, array_column($array, 'id'));
In the above case i get a $key value of 0 but the key value i want to get is 1. if is possible i want to use array_search to find where id=>2 and size=>1 in $array.
Any help will be appreciated thanks.