If I write a function like
function exd ($user = null) {
return $user;
}
If I call the function with no variable like
exd();
The value will be null?
But if I give the function a variable does the variable that I give become `$user`?
exd('account1');
Thanks couldn’t find it in the docs so thought I would ask here?!
Calling
exd()returns null because$useris set to null as default value.If you useexd('account1')it’ll returnaccount1. Because$uservariable inside the function gets a valueaccount1. Outside of the function you wont be able to get the value of$user.