What are the 3 scope levels available in php and how would you define them?
Answer / Varun Yadav
PHP has three scope levels: Global, Function, and Local/Private.
- Global scope: Variables declared outside of any function have global scope and can be accessed from anywhere within your script.
- Function scope: Variables declared inside a function are only available within that function.
- Local/Private scope (from PHP 5.3 onwards): Use the keyword 'private' to create variables with local scope, which are accessible only within the same class.
| Is This Answer Correct ? | 0 Yes | 0 No |
How can you parse files that were not ending with .php by using Apache?
Where do we use get and post?
What is php and sql?
Is jquery better than javascript?
Is php used anymore?
What is form validation in php?
Is php 7.0 stable?
Which is the best php framework for a beginner?
Php program to generate fibonacci series?
What does trim () do in javascript?
What are traits? How is it used in php?
What is session management php?