In PHP, superglobals are ______ that are always accessible, regardless of scope.

  • Predefined variables
  • User-defined variables
  • Private variables
  • Local variables
The correct option is 1. Superglobals in PHP are predefined variables that are always accessible, regardless of scope. They are built-in variables provided by PHP that are automatically available in all scopes throughout a script. Superglobals are prefixed with a special character, such as $_, to differentiate them from regular variables. They are predefined by the PHP language and serve specific purposes, such as accessing form data, server information, or session data. Examples of superglobals in PHP include $_GET, $_POST, $_SERVER, and $_SESSION. Superglobals allow developers to access important information or resources easily without the need for additional declarations or modifications. Learn more: https://www.php.net/manual/en/language.variables.superglobals.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *