Jump to content

Array_unique problem


raimis100

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.