To Find the Occurrence of one string inside other :
We can use the strpos() function which is used to find the occurrence of one string inside other. For case-insensitive search we can use stripos() function.

Example 1 : Case-sensitive Search

 <?php

$myString = "Welcome to Code PHP Online";
$find = "Online";

if (strpos($myString, $find) !== false)
{
    echo "$myString contains $find";
}
else
{
    echo "$myString not contains $find";
}

?>

  /*

  Output :

  Welcome to Code PHP Online contains Online

  */
                            

Example 2 : Case-insensitive Search

 <?php

$myString = "Welcome to Code PHP Online";
$find = "online";

if (stripos($myString, $find) !== false)
{
    echo "$myString contains $find";
}
else
{
    echo "$myString not contains $find";
}

?>

  /*

  Output :

  Welcome to Code PHP Online contains online

  */