<html><body>
<?php

/*
Global variables
global
$GLOBALS array
*/

$n = 5;

function f()
{
        $n = 6;
        echo "In f: \$n = $n<BR>\n";
	echo "The global n is: ", $GLOBALS["n"], "<BR>\n";
	$GLOBALS["n"]++;
	echo "The global n is now: ", $GLOBALS["n"], "<BR>\n";
	$n = 7;
	echo "After changing the local n to 7, in f: \$n = $n<BR>\n";
        global $n;
        echo "After using global, in f: \$n = $n<BR>\n";
	$n = 8;
}
f();
echo "In program after calling f: \$n = $n<BR>\n";

function g()
{
        echo "In g: \$n = $n<BR>\n";
        $n = 99;
        echo "In g: \$n = $n<BR>\n";
}
g();
echo "In program after calling g: \$n = $n<BR>\n";

?>
</body></html>
