Use strpos() to find the first occurrence of a substring within a string.
Source Code
$myString = "Hello, world!";
$pos = strpos($myString, "world");
if ($pos !== false) {
echo "The position of 'world' is: " . $pos;
} else {
echo "'world' not found.";
}