Calculate the most similar string in an array

Didn’t know you could do this, but PHP supports functions for finding the ‘Levenshtein’ algorithm. Given an array of strings, and a target, you can easily find the string in the array most like (though not necessarily the same as) the target.

Advertisements
Calculate the most similar string in an array

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s