How can you compare two strings to see if any part of the string matches even if it is separated by paces or extra characters etc. Sorry i can't really put into words what i need to do so I'll give an example.
Say you've got two variables:
Code: Select all
<?php
$variable1 = "The quick brown fox jumped over the fence";
$variable2 = "jumped fox";
?>Am I getting somewhere near to explaining what i need to do here?
Basically, I want an
Code: Select all
<?php
if(/*some string function*/($variable1, $variable2) !== false) {
/*Do Some thing*/
} else {
/*Do other*/
}
?>Is there a string function which will do this or am I fighting a losing battel here?
Case insensitive would be great too!
Thanks