Is it possible to (in some format), return a variable containing information from a function in PHP
eg.
function setuplogin($email,$pwd){
if(!$email || !$pwd){ return $error = 'not possible'; }
}
So that on the page where it was called
<?php echo $error;?>
would work
EDIT:
It would not be possible to simply echo the function as this same function could also be set to
return $success = 'congrats'; and called on page with <?php echo $success;?>
It sounds like what you want is to be able to return multiple things: whether the function succeeded or failed, and a message to go along with it. You can do that by returning an array:
The caller can do: