PHP levenshtein() Function

PHP lcfirst() Function
PHP localeconv() Function

What is the syntax of the LEVENSHTEIN() function in php?

levenshtein(string1,string2,insert,replace,delete)
ParametersDescription
string1Required. First string to compare
string2Required. Second string to compare
insertOptional. The cost of inserting a character. Default is 1
replaceOptional. The cost of replacing a character. Default is 1
deleteOptional. The cost of deleting a character. Default is 1
PHP levenshtein() method

examples of the LEVENSHTEIN() function

Example 1. In this example, we calculate the Levenshtein distance between two strings.

<?php
echo levenshtein("Hello World","ello World");
echo "<br>";
echo levenshtein("Hello World","ello World",10,20,30);
?>
PHP lcfirst() Function
PHP localeconv() Function
en English
X
Scroll to Top