PHP - $GLOBALS array? Please can you explain?

Smith

New member
<?

$a = 5;
$b = 10;

function mul()
{
$GLOBALS['b'] = $GLOBALS['a'] * $globals['b'];
}

mul;

print $b;

?>

The above prints 10. Is $GLOBALS a proper syntax in PHP? I got the example from a training package and I think it should be $global $a*$b? Any ideas?
 
Back
Top