PHP: Remove duplicates items of an array based on similarities