PHP TutorialLesson 22Free preview
PHP Superglobals
This lesson is part of PHP · All levels
Summary
Superglobals are PHP-inbuilt variables that are always available across scripts without the need for global declaration. For example $_GET, $_POST, $_REQUEST, $_COOKIE, $_SESSION, $_SERVER, and $_FILES. This lesson introduces the use of each, particularly for reading data from forms and user requests.
Key points
- Superglobals are always accessible from anywhere in PHP script.
- $_GET reads the data from the URL, $_POST reads the data form method POST
- $_REQUEST contains a combination of GET, POST, and COOKIE data
- The input from the superglobal must be validated before use
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.