PHP: Check If Two Strings Are Similar

In php, to check the similarity between to strings (text) use the similar_text for example:

Here’s a PHP function that’ll help you check if two strings (texts) are similar. If the strings are 50% similar then the function will output “Duplicate Entries”.

 0) {
	if (count($result)>(count($array1)/2)){
		echo "Duplicate Entries";
	};

};
}

issimilar ( "Hello World Foo Bar Baz", "Hello Foo Bar Baz");

?>

Leave a Reply

Your email address will not be published. Required fields are marked *