raimis100 Posted December 2, 2008 Share Posted December 2, 2008 Hey I wish to remove dublicates from array but when I use array_unique functions then too many variables are dropped out. Even those which are unique are deleted. Is there a way to use other functions to do that ? p.s. I have like 1 mil + records in array . Maybe thats the problem ? Link to comment https://forums.phpfreaks.com/topic/135213-array_unique-problem/ Share on other sites More sharing options...
Mark Baker Posted December 2, 2008 Share Posted December 2, 2008 array_unique() should still work with that many records (assuming you have the memory) albeit somewhat more slowly than you might like. Normally the problems are the reverse, because two elements are considered equal if and only if (string) $elem1 === (string) $elem2. In words: when the string representation is the same. The first element will be used. That doesn't normally remove unique records, but can appear to retain duplicates. But if you have that many records in an array, surely it would be better holding that data in a database Link to comment https://forums.phpfreaks.com/topic/135213-array_unique-problem/#findComment-704333 Share on other sites More sharing options...
raimis100 Posted December 4, 2008 Author Share Posted December 4, 2008 yea , you were right. It really did work. Checked it with my own made function which crashed my pc Link to comment https://forums.phpfreaks.com/topic/135213-array_unique-problem/#findComment-706035 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.