PHP Find Duplicate Strings in String

PHP Find Duplicate Strings in String.

This demo is useful when PHP users need to find phrases in a PHP String

$phrases = find_similar_phrases($string);

 

The function find_similar_phrases() will find the duplicate phrases in the PHP String and return an array containing duplicate phrases / strings.

levenshtein — Calculate Levenshtein distance between two strings

similar_text — Calculate the similarity between two strings