You can use the strpos function to see if the string appears in the variable, which returns the position of the string found or false if not found. For example,
$string = "ABCDEFGHIJKL";
if (!strpos($string,"DEF")) {
echo "String not found!";
} else {
echo "String found!";
}
Only problem here would be if you were searching for "ABC" - this would actually return a zero (because it appears at position 0), which is false. Use the 3 equal signs, which checks the value and the variable type - integer if found, or boolean if not found.
$string = "ABCDEFGHIJKL";
$pos = strpos($string, "ABC");
if ($pos===false) {
echo "String not found!";
} else {
echo "String found!";
}