PHP Similar Text Function, Fix It?

Baseball Freak

New member
I made a new function in php, but when I use it I get errors.
Here is the function:

function simtxt($varone, $vartwo, $prec = 85) { //Checks for wordmistakes (e.g. windoqs)
$varone = strtolower($varone); //Not case sensitive
$vartwo = strtolower($vartwo);
similar_text($varone, $vartwo, $percent);
$percent = sprintf ( '%01.2f', $percent );
if($percent >= $prec) {
return true; //If the both strings are similiar, return true
} else {
return false; //If the both strings arent similiar, return false
}
}
 
Back
Top