I have a text file which contains URLs. How can I remove duplicated addresses with www, and non www? For example I have two URLs:
example.com
www.example.com
I would like to remove one, or remove 'example.com' from www.example.com then I could remove all www.'s
File contains about 8k urls so I can't do this manually
Urls are separated with new lines, or do it in PHP somehow, explode each to array then compare? (this will be a lot time consuming)