Variable Scope and Variable Naming In PHP
Variable Scope
Scope can be defined as the range of availability a variable has to the program in which it is declared. PHP variables can be one of four scope types:
- Local variables
- Function parameters
- Global variables
- Static variables
Variable Naming:
Rules for naming a variable is:
- Variable names must begin with a letter or underscore character.
- A variable name can consist of numbers, letters, underscores but you cannot use characters like + , - , % , ( , ) . & , etc
There is no size limit for variables.
Variable Scope and Variable Naming In PHP
Reviewed by Rajat Jha
on
09:57:00
Rating:
No comments: