Simple question have following code but won't work
//Enter your code here, enjoy!
$correo[] = array('valor'=>'[email protected]','registro'=>'23');
$correo[] = array('valor'=>'[email protected]','registro'=>'24');
$correo[] = array('valor'=>'[email protected]','registro'=>'26');
function arrayUnique($myArray){
if(!is_array($myArray))
return $myArray;
foreach ($myArray as &$myvalue){
$myvalue=serialize($myvalue);
}
$myArray=array_unique($myArray);
foreach ($myArray as &$myvalue){
$myvalue=unserialize($myvalue);
}
return $myArray;
}
$arr= arrayUnique($correo);
var_dump($arr);
What I am trying to do is remove those row which has repetitive valor key for example the result of above array should be
Array (
[0] => Array (
[valor] => '[email protected]'
[registro] => 24
)
)
registroshould be considered?