'
), variables and escape sequences for special characters will not be expanded when they occur in single quoted strings.
"
), PHP will interpret more escape sequences such as \n
for linefeed and \t
for tab for special characters:
strlen
Function
strlen
function is used to find the length of a string.
strpos
Function
strpos
function is used to search for a string or character within a string.
If a match is found in the string, this function will return the position of the first match. If no match is found, it will return FALSE.
Let’s see if we can find the string "a test"
in our string:
"a test"
in our string is position ?.
The reason that it is ?, and not ?+1, is that the first position in the string is 0, and not 1.