Variable scope
Four different variable scopes ( local local; global global; static static; parameter parameter )
Local and global variables:
Global keywords: use keywords inside variables called outside the function; (not recommended)
PHP stores all global variables in an array called $ GLOBALS [index] .
Static scope: When a function is completed, all its variables are usually deleted. However, sometimes you want certain local variables not to be deleted.
parameter scope parameter: the parameter value is passed to the local variable by calling code;
String function
- The concatenation operator: Use " . " To connect two string values .
- strlen () function returns the length of the string (number of characters)
- The strpos () function is used to find a character or a specified text within a string .
If a match is found in the string, the function returns the first matched character position. If no match is found, FALSE is returned .