<?php $str1 = array("key1"=>"aa","key2"=>"bb","key3"=>"cc"); $str2 = array("key1"=>"aa","key5"=>"bb","key3"=>"xx");
var_dump( array_diff_assoc($str1,$str2)); ?>
●実行結果 array(2) { ["key2"]=> string(2) "bb" ["key3"]=> string(2) "cc" }
<?php $str1 = array("key1"=>"30","key2"=>"50"); $str2 = array("key1"=>30,"key2"=>50);
●実行結果 array(0) { }