Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
$GLOBAL - Used to access global variables from anywhere in the PHP script
SUBMITTED BY:
henry1874w
DATE:
June 17, 2017, 1:17 p.m.
FORMAT:
Text only
SIZE:
191 Bytes
Raw
Download
Tweet
HITS:
204
Go to comments
Report
<!DOCTYPE html>
<html>
<body>
<?php
$x = 75;
$y = 25;
function addition() {
$GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];
}
addition();
echo $z;
?>
</body>
</html>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus