You have a PHP script and you need to get data sent in the URL's query string. How would you do this using the $_REQUEST superglobal?

  • Use the $_REQUEST['data'] syntax to access the data directly.
  • Access the data through the $_GET superglobal.
  • Access the data through the $_POST superglobal.
  • Use the $_SERVER['QUERY_STRING'] variable to retrieve the query string.
To retrieve data sent in the URL's query string, you can use the $_GET superglobal. However, if you prefer to use the $_REQUEST superglobal, you can access the data using the same syntax as with $_GET. For example, $_REQUEST['data'] will give you the value of 'data' in the query string. Learn more: https://www.php.net/manual/en/reserved.variables.request.php
Add your answer
Loading...

Leave a comment

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