PHP includes a function similar_text very rarely used but quite useful that compares two strings and returns the percentage of similarity between two.