PHP superglobals are only accessible within functions.
- FALSE
- TRUE
The correct option is 2. PHP superglobals, such as $_POST, $_GET, and $_SERVER, are accessible from any part of the script, including both within and outside functions. Superglobals are automatically available in all scopes and can be accessed from anywhere within your PHP script without the need for special considerations or modifications. They provide important information and resources that are needed across different parts of the script, making them globally accessible. It is important to note that superglobals can be accessed from both functions and other parts of the script. Learn more: https://www.php.net/manual/en/language.variables.superglobals.php
Loading...
Related Quiz
- In PHP, you can include a file using the include or require statement, which takes the path to the file as the ______.
- Which of the following can be done using either echo or print in PHP?
- Which function gives us the number of affected entries by a query?
- You are writing a PHP script and you want to execute a block of code as long as a certain condition is true. How would you do this using a while loop?
- How many dimensions can a multidimensional array in PHP have?