Can you provide an example of a superglobal in PHP?

  • $_POST
  • $super
  • @superglobal
  • $globals
The correct option is 1. An example of a superglobal in PHP is $_POST. The $_POST superglobal is an associative array that contains variables passed to the current script via the HTTP POST method. It allows you to access data that has been submitted through an HTML form or sent via an HTTP POST request. The $_POST superglobal provides a convenient way to retrieve and work with form data in PHP. Other examples of superglobals in PHP include $_GET, $_SESSION, and $_SERVER. Learn more: https://www.php.net/manual/en/reserved.variables.post.php
Add your answer
Loading...

Leave a comment

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