I have this code:
require_once('../config.php');
function ha(){
global $user; /* THIS I NEED TO DEFINE LOCAL ONLY ACCESS FROM THIS FUNCTION */
return $user;
}
echo ha();
echo $user; /* GLOBAL VARIABLE VALUE */
So how to define in function local variable that will be accessed throught inside function ha()? So the outout from the echo ha(); will be value $user that is stored in config.php, and last line echo $user needs to be empty on echo...when i define in function static $user i get empty value...so how to define in php static value of variable that is read from config.php and access value only in function?