guys I own a PHP project where I have a file with the functions that must be executed, in this same file I have declaration of the global variables one of these variables is:
$usua = $_SESSION['user']['username'];
This variable I use a lot in other functions where users have already logged in the system, but I do not use it in the functions for the recovery of access codes, the error that I get is that of undefined variable, I would like to know if can guide indicating how I can give instructions to my code so that when it is not defined the variable is omitted, or it is assigned the value 0 or null. try with a if (!$usua)
but then in the function where I require the value of this variable with the call of global $usua
does not work indicating that the variable is null, other times it says it is undefined etc etc.