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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -