my case is like this:
<?php
$var1 = "Top of British";
$var2 = "Welcome to British, the TOP country in the world";
$var1 = strtolower($var1);
$var2 = strtolower($var2);
if (strpos($var1, $var2) !== FALSE) {
echo "TRUE";
}
?>
its not working, how do i detect the TOP or British is exist on both string?
Remove the punctuation from the strings, convert them both to lowercase, explode each string on the space character into an array of strings and then loop through each looking for any word matches:
DEMO: http://codepad.org/YtDlcQRA