How do I check if a string contains a specific word php code example
Example 1: php find if substring is in string
$result = strpos("haystack", "needle");
if ($result != false)
{
// text found
}
Example 2: How do I check if a string contains a specific word php
$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}