Remove Duplicates from PHP Array
Before you write a quickie function to remove duplicates from a PHP array, check out the PHP array_unique() function. I was about to write a function to de-dupe an array when I remembered that PHP has a builtin function to do just that.
Here is a simple example:
Alternatively, if you just want to know if there are duplicates in an array and not remove them, you could do something like this:
You’re currently reading “ Remove Duplicates from PHP Array ,” an entry on BRADINO
- Published:
- 10.19.07 / 4pm
- Category:
- PHP























it’s help
thank’s
Thanks! Helped me too!
Thanks for clearing it out. More power to the webmaster
thank’s
thanks, i did know php had such a function (among many others)
http://php.net/manual/en/function.array.php
but could not remember the name
Thanks. short n sweet :)