I\'m trying to figure out how I can use a variable that has been set outside a function, inside a function. Is there any way of doing this? I\'ve tried to set the variable t
$var = 1; function() { global $var; $var += 1; return $var; }
OR
$var = 1; function() { $GLOBALS['var'] += 1; return $GLOBALS['var']; }