- A variable which is specified in a function is known as local variable.
- local variable is accessible only with in the function where it was declared.
- the life time of a local variable is with in the function.
- A variable which is specified outside of a function is known as global variable.
- Global variable can be accessed anywhere in the program.
It was an built in multi dimension array in php that stores GETDATA,POSTDATA, cookies, uploader files, error messages occurred in execution and also stores global variables.
The variables present inside $_GLOBAL is called global variables.
Global is keyword of php used for declaring a global variable , a variable declared by using keyword global cant be initialized.