Superglobals are built-in variables that are always available in all scopes: $GLOBALS, $_SERVER, $_REQUEST, $_POST, $_GET, $_FILES, $_ENV, $_COOKIE, $_SESSION.
PHP Web Backend
PHP Tutorial
PHP Forms & Advanced
Advertisement
Google AdSense Slot (LEADERBOARD)
Automated High-CTR Ad Rail • Set Publisher ID in config/adsense.php
Globals
7 min read
•
Chapter 8 of 10
PHP Superglobals
Superglobals are built-in variables that are always available in all scopes: $GLOBALS, $_SERVER, $_REQUEST, $_POST, $_GET, $_FILES, $_ENV, $_COOKIE, $_SESSION.
Example
<!DOCTYPE html><html><body style="font-family:monospace;padding:20px;"><pre><?php\necho $_SERVER['SERVER_NAME'];\n?></pre></body></html>
Try it Yourself >>
Opens live sandboxed code editor
Advertisement
Google AdSense Slot (IN-ARTICLE)
Automated High-CTR Ad Rail • Set Publisher ID in config/adsense.php
Community Q&A & Discussion
Verified
No questions yet. Be the first to start the discussion!