Posted by John Nichel on 04/11/05 21:38
Jochem Maas wrote:
> AndreaD wrote:
>
>> I have a session variable called
>>
>> $_SESSION['total'] the problem is I can't delete/reset it. I have tried
>>
>> $_SESSION['total']= 0;
>>
>> $_SESSION['total']= "";
>
>
> I guess you didn't know/think of trying null:
>
> $_SESSION['total'] = null;
>
> ...which has the same effect as using:
>
> unset($_SESSION['total']); // as you have been told on at least 3 diff
> occasions ;-)
Not true. If you set it to null, it still exists...it's just null. If
you unset it, the variable no longer exists.
$_SESSION['total'] = null;
if ( isset ( $_SESSION['total'] ) ) {
echo ( "Yes" );
} else {
echo ( "No" );
}
unset ( $_SESSION['total'] );
if ( isset ( $_SESSION['total'] ) ) {
echo ( "Yes" );
} else {
echo ( "No" );
}
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@kegworks.com
Navigation:
[Reply to this message]
|