php · PHP basics
How do you access a PHP superglobal variable inside a function?
Answers
- By declaring it as global inside the function
- By passing it as an argument to the function
- By using the 'this' keyword
- Superglobals are always accessible, no need for special syntax