In PHP there are several functions or methods to compare the equality between two strings. For example "Hello world" == "Hello world"
. But let's say that I have strings that are almost equal. Can these be compared and like get a value of similarity (i.e. 97% are equal).
<?php
$a = "Stack Overflow";
$b = "Stack-Overflow";
$result = str_compare_similarities($a, $b); // should return something like 0.958 for example
?>
I don't think that there's a function for this in PHP (or is there?). MySQL has for instance the function FULLTEXT
that compares how much two strings are equal. But can it be solved with PHP?