why Global Variables are Superglobals in php explain with a example ?
Global Variables - Superglobals
1442
19-Jul-2018
Updated on 19-Jul-2018
Prakash nidhi Verma
19-Jul-2018PHP Global Variables - Superglobals :
it's a predefined variables in PHP which are always accessible of scope and you can access them from any function and class. The PHP superglobal variables are:
PHP $GLOBALS:
$GLOBALS[index] in PHP it means which is stores all global variables in array. The index holds the name of the variable.
PHP $_SERVER :
it is holds information about headers, paths and script locations in PHP super global variable.