Difference between Global and Local Scope variables in PHP ?
Global and Local Scope
1412
19-Jul-2018
Updated on 19-Jul-2018
Prakash nidhi Verma
19-Jul-2018Global Scope:
Global scope is a variable which declared outside a function and can only be accessed outside a function.
Example :
Local Scope:
A variable declared within a function has a LOCAL SCOPE and can only be accessed within that function.
Example :