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
This line in your function: $var + 1 will not change the value assigned to $var, even if you use the global keyword.
$var + 1
$var
Either of these will work, however: $var = $var + 1; or $var += 1;
$var = $var + 1;
$var += 1;