note 75555 added to function.array-unique
| From: | jmw at petriweb dot org | Date: | Tue, 05 Jun 2007 11:33:42 +0000 |
| Subject: | note 75555 added to function.array-unique | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127227@lists.php.net to get a copy of this message | ||
The intersection won't work, since:
intersection (['a','a','b','c'] ,
UNIQUE(['a','a','b','c']) )
=
intersection (['a','a','b','c'],
['a','b','c'])
=
['a','a','b','c']
While you only want ['a'] or ['a','a'] to be the result. The only
solution is to write your own function.
----
Server IP: 194.109.193.76
Probable Submitter: 131.155.69.61
----
Manual Page -- http://www.php.net/manual/en/function.array-unique.php
Edit -- https://master.php.net/note/edit/75555
Del: integrated -- https://master.php.net/note/delete/75555/integrated
Del: useless -- https://master.php.net/note/delete/75555/useless
Del: bad code -- https://master.php.net/note/delete/75555/bad+code
Del: spam -- https://master.php.net/note/delete/75555/spam
Del: non-english -- https://master.php.net/note/delete/75555/non-english
Del: in docs -- https://master.php.net/note/delete/75555/in+docs
Del: other reasons-- https://master.php.net/note/delete/75555
Reject -- https://master.php.net/note/reject/75555
Search -- https://master.php.net/manage/user-notes.php