This is simple function
function check_nickname($item)
{
if (preg_match('/^[a-z\d_]{1,15}$/', $item)) {
return true;
} else {
return false;
}
}
It returns only true or false.
But If it is false I want it to return False + some text in a string or something.
if(check_nickname($item))
will get true/false. but if it is false then how can I echo some text string ?
To do that you need to send a variable to the function that can be modified within the function. You do that with references. Example explains it better than words;