Remove Duplicate Values From An Array
- Started
- Last post
- 4 Responses
- JamesEngage
I've just moved an SQL database and backend between servers.. and whle I wait for the permissions to be set properly! I need to remove duplicates vales from the arrays it is pumping out...
basically I have an array e.g (5,5,5,6,7,7,8,5,3)
Anyone that has an array that actually removes the duplicates? Tried the ones on layer51 and they are mighty buggy
- unfittoprint0
use a loop to read the aray values, while adding uniques to another array.
an inner loop will check if the value inside the newly created array already exists.
and use unset ($array[]); to delete the looped values, for faster check.
- iDp0
teh mastah has spoken!
unfit do you have any of your work online? I'd love to see what you do with all this knowledge.
- armed_rob0
I want to see some work too!
Its crazy how much unifit knows...!
- JamesEngage0
cheers unfit, you're a good lad... I've actually started doing that.. will let you know how I get on...
not bothering with the 'for speed' thing just yet... just want to get it at least working :)