You can use PHP’s built-in function called str_contains to check if the given word exists in a string or not. If it finds the word it will return true otherwise it will return false. This function is case-sensitive.
<?php
$word = "fox";
$mystring = "The quick brown fox jumps over the lazy dog";
// Test if string contains the word
if(str_contains($mystring, $word)){
echo "Word Found!";
} else{
echo "Word Not Found!";
}
?>