Jump to content

Removing duplicates


Minase

Recommended Posts

I'm not sure which operating system you are using, but if I was on a Linux based system, I would write a very quick script.

 

sort -u <filename.txt> > newfilename.txt

 

You could actually call it from a php script if needed.

 

If you really have the need to do this in php, the only way I could think of is to read the entire file into an array.  Then use the array_unique function.  Then write the array back out to the file.

 

 

Link to comment
https://forums.phpfreaks.com/topic/125454-removing-duplicates/#findComment-648583
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.