is there a way to create my own custom superglobal variables like $_POST and $_GET?
There are about nine superglobal variables in PHP which are sometimes referred to as automatic globals .
The $_REQUEST variable provides the contents of the $_GET , $_POST , and $_COOKIE arrays.
The PHP $_REQUEST is a PHP superglobal variable that is used to collect the data after submitting the HTML forms as the $_REQUEST variable is useful to read the data from the submitted HTML open forms. $_REQUEST is an associative array that by default contains contents of an $_GET, $_POST, and $_COOKIE.
Static class variables can be referenced globally, e.g.:
class myGlobals { static $myVariable; } function a() { print myGlobals::$myVariable; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With