Doubt about PHP global variables

Asked

Viewed 27 times

-2

So far I don’t know how the variables work: $_SESSION, $_POST, and $_GET, could someone explain to me how it works? Thanks!!!

1 answer

-1


Are superglobal variables of PHP, where it is available in all Scopes of the script

$_SESSION is an array that stores all user session information, lasts by default 14 minutes all information in variable.

$_POST is an array that stores all the POST type parameters of the request.

$_GET is an array that stores all the GET type parameters of the request

All are a 'superglobal', or automatic global variable. This means that it is available in all scopes by the script. No need to make global $variable; to access it within a function or method.

More information: https://www.php.net/manual/en/reserved.variables.session.php https://www.php.net/manual/en/reserved.variables.get.php https://www.php.net/manual/en/reserved.variables.post.php

Browser other questions tagged

You are not signed in. Login or sign up in order to post.