Suppose you do find the user name invalid and you are not able to return the member id, do you return FALSE, 0 or appropriate error messages.
I used to return FALSE so far, but when I tried to echo the returned FALSE, I don't get anything it returns empty string not FALSE.
example scenario
Code: Select all
echo call_me(3); //This echo call returns no value,,,the return value is EMPTY instead of FALSE
echo call_me(10);//This returns 1 instead of TRUE,,,is this desirable as well...
function call_me($number){
if ($number == 10) return TRUE;
else return FALSE
}2. Do you feel the behaviors desirable??? Advise me the best coding practices....Thanks