I would like to create a function that uses a global variable to give a value to one of it's initializing attributes like this:
$APP = 0;
function auth($A=$APP, $T="blah")
{
//...........
}
The problem I'm having (I think it's obvious) is that I cannot assign the value of a variable to a function initialization variable. Would it work if I used a constant instead? Is there another way around this?
Basically I just need to have this function default to a globally supplied value if none is given durring a function call.
HELP!
Thanks 🙂