|
|
PHP similar_text Function
|
Tutorials » Php »
|
Topic |
What is similar_text Function and how it is used in string?
|
|
Explanation |
|
In PHP this function is used to calculate the similarity between two strings.
Syntax:
similar_text(string1,string2,percent)
In the above syntax "string1" specifies the first string to compare,"string2" specifies the second string to
compare, "percentage" specifies a variable to store the similarity in percentage.
Example:
<?php
echo similar_text("Hello World","Hello Peter");
?>
Result:
7
In the above similar_text function example two strings are compared to display the percentage of similar characters.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|