Advertisement

Responsive Advertisement

6. PHP Variable Scope

 


In PHP, variables can be declared anywhere in the script.

The scope of a variable is the part of the script where the variable can be referenced/used.

PHP has three different variable scopes:

·         local

·         global

·         static

 

Example

Variable with global scope:




Post a Comment

0 Comments