How do I remove duplicates in an array?
If I have an array, let's say:
"test", "place", "park", "park", "test", "run"
I want to remove the duplicate values in the array so that each cell is unique:
"test", "place", "park", "run"
How can I accomplish this? Is there a function I can use for this?
Believe it or not: array_unique().
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
That did it! Thanks!
You know, I did come across that earlier. It didn't work for me, but I went back and tried it, and apparently I misspelled my variable.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread