- array_intersect: documentation ( source)
- array_column: documentation ( source)
- var_export: documentation ( source)
<?php
$new_order = [
'PHOTOS',
'VIDEOS',
'DOCUMENTS'
];
$downloads = [
['type' => 'PHOTOS'],
['type' => 'DOCUMENTS'],
['type' => 'DOCUMENTS'],
//['type' => 'VIDEOS'],
['type' => 'PHOTOS'],
];
var_export(
array_intersect(
$new_order,
array_column($downloads, 'type')
)
);