string is present in string php code example
Example 1: php find if string contains
if (strpos($string, 'substring') !== false) {
// do stuff
}
Example 2: php find if substring is in string
$result = strpos("haystack", "needle");
if ($result != false)
{
// text found
}