- print_r: documentation ( source)
<?php
$mediaarray = array(
array(
'file_type_id'=>'first file',
'other_stuff'=>'first other'
),
array(
'file_type_id'=>'second file',
'other_stuff'=>'second other'
)
);
$mediafiletype = array(
array(
'id'=>'blabla',
'other'=>'first other'
),
array(
'id'=>'second file',
'other'=>'second other'
)
);
$baseUrlKeyMediaArray = array();
$NotbaseUrlKeyMediaArray = array();
foreach ($mediaarray as $key => $mavalue) {
$match = false;
foreach ($mediafiletype as $mftvalue) {
if ($mavalue['file_type_id'] == $mftvalue['id']) {
$pathname = $mftvalue['base_url'];
$baseUrlKeyMediaArray[$pathname] = $mavalue;
$match = true;
}
}
if(! $match) {
$NotbaseUrlKeyMediaArray[] = $mavalue;
}
}
print_r($baseUrlKeyMediaArray);
echo "<br />";
print_r($NotbaseUrlKeyMediaArray);