This question already has an answer here:
- PHP - Check if two arrays are equal 14 answers
I have two arrays i want to match exact both keys and values of arrays one of array be three dimensional or more Example
$arr1 = ['status'=>true,'message'=>'data saved'];
$arr2 = ['status'=>true,'message'=>'data saved'];
in this scenario array return 1 but they are not equal
$arr1 = array("messagess"=>"data added","status" => true);
$arr2 = array("status" => true,'message'=>'data has been added');
echo count(array_intersect_assoc($arr1,$arr2));
Expected should be true if both exact match otherwise false. I have tried array_intersect() and other methods but failed.
Please Guide!
Thank in Advance
</div>