PHP Instr
PHP Instr
instr is a function used to find the first occurrence of a sub-string within a larger string.
Unlike ASP or VB, PHP does not use the terminology instr, but instead uses strpos.
Although named differently, strpos has the same basic functionality as instr.
strpos syntax:
string1
String to search in
string2
start
Optional. This is the character position to start at. This defaults to the first character if
omitted (start = 0 by default).
Return value:
Returns the integer position of the first character withing string1. FALSE is returned if
string2 is not found within string1.
Whereas,