PHP theorytheory 0/50 · 0%
Fundamentals · easy

9. Superglobals

Built-in global arrays.

PHP provides superglobals like $_GET, $_POST, $_SESSION, $_SERVER, $_COOKIE, and $_FILES that are accessible in any scope without needing 'global'. They carry request data, server info, and session state.

Because superglobals contain user input, values from $_GET/$_POST must always be validated and sanitized before use.

Check your understanding

  1. 1. Which superglobal holds form data submitted via POST?

  2. 2. Which superglobal contains web server and request info?