PHP:: array_unique for arrays inside array -
i need array_unique arrays inside array.
the case - should equal, output "not equal":
<?php $arr=array(array('a',1),array('a',2)); $arr2=array_unique($arr); if($arr2==$arr){ echo "equal"; } else{ echo "not equal"; } ?>
how should code fix output "equal"?
thanks, yosef
you should modify call array_unique
have include sort_regular
flag.
$arr2 = array_unique($arr, sort_regular);
Comments
Post a Comment