currently i’m using this php function :
function if_exist(&$argument, $default = '')
{
if (isset ($argument))
{
echo $argument;
}
else
{
echo $default;
}
}
i want this function to unset the variables $argument(passed by reference) and $default just after echoing their value, how can i do this?
Thanks in advance.
According to the manual for unset:
I assume this is the issue you’re encountering. So, my suggestion is to simply set
$argumenttoNULL. Which, according to the NULL docs will "remove the variable and unset its value.".For example:
$argument = NULL;