These are multi-dimensional associative arrays, you can recursively do an array_diff_assoc, find out here:
array-diff-assoc-php[
^]
See example:
<?php
function array_diff_assoc_recursive($array1, $array2)
{
foreach($array1 as $key => $value)
{
if(is_array($value))
{
if(!isset($array2[$key]))
{
$difference[$key] = $value;
}
elseif(!is_array($array2[$key]))
{
$difference[$key] = $value;
}
else
{
$new_diff = array_diff_assoc_recursive($value, $array2[$key]);
if($new_diff != FALSE)
{
$difference[$key] = $new_diff;
}
}
}
elseif(!isset($array2[$key]) || $array2[$key] != $value)
{
$difference[$key] = $value;
}
}
return !isset($difference) ? 0 : $difference;
}
$a1=Array
(
"0" => Array
(
"file" => "newhotfolder.gif",
"path" => "images/newhotfolder.gif",
"type" => "gif",
"size" => "1074",
"md5" => "123812asdkbqw98eqw80hasdas234234"
),
"1" => Array
(
"file" => "image.gif",
"path" => "images/attachtypes/image.gif",
"type" => "gif",
"size" => "625",
"[md5]" => "7bbb66e191688a86b6f42a03bd412a6b"
),
"2" => Array
(
"file" => "header.gif",
"path" => "images/attachtypes/header.gif",
"type" => "gif",
"size" => "625",
"md5" => "71291239asskf9320234kasjd8239393"
)
);
$a2=Array
(
"0" => Array
(
"file" => "newhotfolder.gif",
"path" => "images/newhotfolder.gif",
"type" => "gif",
"size" => "1074",
"md5" => "8375h5910423aadbef67189c6b687ff51c"
),
"1" => Array
(
"file" => "image.gif",
"path" => "images/attachtypes/image.gif",
"type" => "gif",
"size" => "625",
"[md5]" => "7bbb66e191688a86b6f42a03bd412a6b"
),
"2" => Array
(
"file" => "header.gif",
"path" => "images/attachtypes/footer.gif",
"type" => "gif",
"size" => "625",
"md5" => "1223819asndnasdn2213123nasd921"
)
);
print_r(array_diff_assoc_recursive($a1, $a2));
?>