Javatpoint Logo
Javatpoint Logo

PHP string similar_text() Function

The string similar_text() function is in-built PHP function. It is used to calculates the similarity between two strings in percent.

Note: The Levenshtein() function is faster than similar_text() function. It will give us more accurate result.

Syntax:

Parameter Description Required/Optional
String 1 Specify the first string to be compared. required
String 2 Specify the first string to be compared. required
percent Specify a variable name for storing. Optional

Example 1

Output:

6

Example 2

Output:

48

Next TopicPHP String





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA