Comparing strings in PHP and removing one of them from the array if they are similar

priceorchid

New Member
Let say I have an array like this:
  • Band of Horses - Is There a Ghost
  • Band Of Horses - No One's Gonna LoveYou
  • Band of Horses - The Funeral
  • Band of Horses - The Funeral (lyricsin description)
  • Band of Horses - Laredo
  • Band Of Horses - Laredo on Letterman5.20.10
  • Band of Horses - "The Great SaltLake" Sub Pop Records
  • Band Of Horses - "No One's Gonna LoveYou"
  • Band of Horses perform Marry Song atTromso Wedding
  • Band Of Horses - No One's Gonna LoveYou
  • 'Laredo' by Band of Horses on Q TV
  • Band of Horses, On My Way Back Home
  • Band of Horses - cigarettes weddingbands
  • Band Of Horses - "Cigarettes WeddingBands"
  • Band Of Horses - I Go To The BarnBecause I Like The
  • Our Swords - Band of Horses
  • Band Of Horses - "Marry song"
  • Band of Horses - Monsters
  • Band Of Horses - No One's Gonna LoveYou
The New Array would have:
  • Band of Horses - Is There a Ghost
  • Band Of Horses - No One's Gonna LoveYou
  • Band of Horses - The Funeral
  • Band of Horses - Laredo
  • Band of Horses - "The Great SaltLake" Sub Pop Records
  • Band of Horses, On My Way Back Home
  • Band of Horses - cigarettes weddingbands
  • Band Of Horses - I Go To The BarnBecause I Like The
  • Our Swords - Band of Horses
  • Band Of Horses - "Marry song"
  • Band of Horses - Monsters
How would you go about comparing each string to every other string in the list in PHP and if they are similar, remove them.I consider these similar:
  • Band of Horses - The Funeral
  • Band of Horses - The Funeral (lyrics in description)
Another example:
  • Band of Horses - Laredo
  • Band Of Horses - Laredo on Letterman5.20.10
 
Back
Top