note 28375 added to function.array-unique

From: Date: Fri, 10 Jan 2003 23:20:40 +0000
Subject: note 28375 added to function.array-unique
Groups: php.notes 
Request: Send a blank email to php-notes+get-41978@lists.php.net to get a copy of this message
in addition to bisqwit: in some cases you can simply use serialize instead of recursivemakehash(). function array_unique2($input) { $tmp = array(); foreach($input as $a => $b) $tmp[$a] = serialize($b); $newinput = array(); foreach(array_unique($tmp) as $a => $b) $newinput[$a] = $input[$a]; return $newinput; } Have fun Juggler -- http://www.php.net/manual/en/function.array-unique.php http://master.php.net/manage/user-notes.php?action=edit+28375 http://master.php.net/manage/user-notes.php?action=delete+28375 http://master.php.net/manage/user-notes.php?action=reject+28375

« previous php.notes (#41978) next »