What is the correct syntax for using the strpos function in PHP?

The strpos function in PHP is used to find the position of the first occurrence of a substring within a string. The correct syntax for using strpos is as follows: strpos($haystack, $needle). $haystack is the string to search in, and $needle is the substring to search for. The function returns the position of the first occurrence of $needle in $haystack, or false if the substring is not found.

$haystack = "Hello, world!";
$needle = "world";
$pos = strpos($haystack, $needle);

if ($pos !== false) {
    echo "The substring '$needle' was found at position $pos.";
} else {
    echo "The substring '$needle' was not found in the haystack.";
}