$GLOBALS is a super global variable which is used to access global variables from anywhere in the PHP script(within function).
Syntax
$GLOBALS['name']
Example
$a=10;
function testGlobal(){
echo $GLOBALS['a'];
}
Output
10
Copyright ©2022 coderraj.com. All Rights Reserved.