Fog Juice Posted August 24, 2009 Share Posted August 24, 2009 Hello, I'm using array_unique() to clear out duplicate values in an array that contains about 1125 items. All items in the array are string value but for some reason, array_unique() will clear out duplicates and in some instances leave an empty value in the array. Does anyone know what might cause this? *update* I tried array_keys(array_flip()) and that seems to work better. Any idea what the problem is with array_unique()? Quote Link to comment Share on other sites More sharing options...
mikesta707 Posted August 24, 2009 Share Posted August 24, 2009 Array unique preserves the keys of the array, (as it says on the php.net documentation) so that probably has something do to with the empty values. But I don't use array_unique to often so beyond that i don't really know Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.