I am trying to intersect an multidimensional array with an indexed array and return matching sku's. Below are my array
$products=[
{
"id": "6",
"sku": "a",
},
{
"id": "15",
"sku": "b",
},
{
"id": "16",
"sku": "c",
},
{
"id": "17",
"sku": "d",
},
{
"id": "18",
"sku": "e",
}
]
$skus=[
"a",
"c",
"e"
]
How do intersect both arrays and return $products
array with matching items.
array_intersect
does not provide expected results