PHP stores all global variables in an array called $GLOBALS[index].
<?php
$x=5;
$y=10;
$GLOBALS['y']=$GLOBALS['x']+$GLOBALS['y']; //Same as "$y = $x + $y;"
echo $y;
?>
<?php
$x=5;
$y=10;
$GLOBALS['y']=$GLOBALS['x']+$GLOBALS['y']; //Same as "$y = $x + $y;"
echo $y;
?>
No comments :
Post a Comment