Contact Us || Privacy Policy || About Us |
|
PHP VariablePHP Variables are "containers" for storing information. PHP Variables are used to store data, like string of text, numbers, etc. PHP Variables
Example1 Output:- ![]() Example2 Output:- ![]() PHP Variables ScopePHP has three different variable scopes:
Local Variable Scope in PHPA variable declared within a function has a LOCAL SCOPE and can only be accessed within that function: Example Global Variable Scope in PHPA variable declared outside a function has a GLOBAL SCOPE and can only be accessed outside a function: Example PHP The static Keyworduse the static keyword when you first declare the variable: Example |