note 77259 added to function.array-unique
| From: | tsikano at attglobal dot net | Date: | Tue, 21 Aug 2007 23:20:11 +0000 |
| Subject: | note 77259 added to function.array-unique | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129684@lists.php.net to get a copy of this message | ||
//Suggestion for being able to use array_unique on array of arrays/objects:
foreach ($arrayOfArrays as $key=>$value) {
$arrayOfArrays[$key] = "'" . serialize($value) . "'";
}
$arrayOfArrays = array_unique($arrayOfArrays);
foreach ($arrayOfArrays as $key=>$value) {
$arrayOfArrays[$key] = unserialize(trim($value, "'"));
}
----
Server IP: 203.89.181.186
Probable Submitter: 202.78.240.7
----
Manual Page -- http://www.php.net/manual/en/function.array-unique.php
Edit -- https://master.php.net/note/edit/77259
Del: integrated -- https://master.php.net/note/delete/77259/integrated
Del: useless -- https://master.php.net/note/delete/77259/useless
Del: bad code -- https://master.php.net/note/delete/77259/bad+code
Del: spam -- https://master.php.net/note/delete/77259/spam
Del: non-english -- https://master.php.net/note/delete/77259/non-english
Del: in docs -- https://master.php.net/note/delete/77259/in+docs
Del: other reasons-- https://master.php.net/note/delete/77259
Reject -- https://master.php.net/note/reject/77259
Search -- https://master.php.net/manage/user-notes.php