strpos can be understood as the number of bytes in the haystack before the first occurrence of the needle.
var_dump(strpos("haystack", "hay")); // int(0)
var_dump(strpos("haystack", "stack")); // int(3)
var_dump(strpos("haystack", "stackoverf...