PHP similar_text() Function


The similar_text() function is used to calculates the similarity between two strings in percent.

Syntax
similar_text(string1,string2,percent)
Parameters
  • String 1 - (Required) Specify the first string to be compared.
  • String 2 - (Required) Specify the second string to be compared.
  • Percent - (Required) Specify a variable name to be stored similarity in percent.
Example
<?php
    similar_text("Good Morning","Good Evening",$per);
    echo $per;
?>

Output

75

Prev Next