I have a function in php that looks like this:
function getPwd ($type = 'ADMIN', $user = 'ADMINISTRTOR')
-- mysql connection to Datatbase and fetch necessary info in order to return the results back
--- here is my function call:
getPwd('USER', 'ADAM'); --> returns the password for user Adam
getPwd(); --> returns the password for admin Administrator
My question is that what if I set the variables to getPwd fuction like this?
I wish to know how can I still get the return type of administrator's password. If I pass two variables as null, I will not get the default value as in 'ADMIN' or 'ADMINISTRATOR'. Is there a way for me to use the above function and still get the correct return from the function with the default input value as 'ADMIN' and 'ADMINISTRATOR'? Thanks