note 56471 deleted from function.array-flip by mazzanet
| From: | mazzanet@php.net | Date: | Sun, 04 Sep 2005 05:46:00 +0000 |
| Subject: | note 56471 deleted from function.array-flip by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-94713@lists.php.net to get a copy of this message | ||
Note Submitter:
----
you should not use the solution posted by t0russ at gmail dot com tp remove duplicates from an
array.
PHP does this itself in a very faster way with the nativ function array_unique()!
<?PHP
$ar=array("abba","boomer","boston","abba","bozer");
$ar=array_unique($ar);
?>
output:
Array
(
[3] => abba
[1] => boomer
[2] => boston
[4] => bozer
)
This is much faster and the indexesare not messed up...