?php function unique( $array) { if(!is_array($array) || empty($array)) return false; foreach($array as $v) $v = serialize($v); $array = array_unique($array); foreach($array as $v) $v = unserialize($v); unset($v); return true; }
<?php function unique(& $array) { if(!is_array($array) || empty($array)) return false; foreach($array as &$v) $v = serialize($v); $array = array_unique($array); foreach($array as &$v) $v = unserialize($v); unset($v); return true; }