strpos: Find the position of the first occurrence of a substring in a string.
strpos have 3 parameter and are following:
- haystack:The string to search in.
- needle:If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
- offset: It is optional, If provided then search will start this number of characters counted from the beginning of the string. The offset cannot be negative.
Note: It is case sensitive.
Different Examples of strpos
var_dump(strpos('web technology experts','web'));//int(0) var_dump(strpos('web technology experts','technology'));//int(4) var_dump(strpos('web technology experts','Technology'));//int(4) var_dump(strpos('web technology experts','technology',4));//int(4) var_dump(strpos('web technology experts','technology',5));//bool(false) var_dump(strpos('web technology experts','expertss',6));//bool(false)