I need to recover data from the validated user that is saved in $ return, which works because I checked it with a var_dump ($ return), but when I want to dump the data of $ return to an array, it puts them null. Thanks from now.
$retorno = Usuarios::validar($user, $pass);
if ($retorno) {
$usuario["idusuario"] = $retorno->idusuario;;
$usuario["nombre"] = $retorno->nombre;
$usuario["email"] = $retorno->email;
var_dump($retorno);
var_dump($usuario);
}
Result
array(3) {
["idusuario"]=> string(1) "1"
["nombre"]=> string(18) "José"
["email"]=> string(19) "[email protected]"
}
array(3) {
["idusuario"]=> NULL
["nombre"]=> NULL
["email"]=> NULL
}