What function in PHP is recommended to use instead of strpos for matching specific words in a string?

When matching specific words in a string in PHP, it is recommended to use the `preg_match` function with a regular expression pattern. This allows for more flexibility and accuracy in matching words, as well as the ability to handle case-insensitive matching or matching multiple occurrences of a word.

$string = "The quick brown fox jumps over the lazy dog";
$word = "fox";

if (preg_match("/\b" . $word . "\b/i", $string)) {
    echo "Word '$word' found in the string.";
} else {
    echo "Word '$word' not found in the string.";
}