11
hulk8
Re: How destroy a variable in a session ?
  • 2006/10/16 17:11

  • hulk8

  • Just popping in

  • Posts: 11

  • Since: 2005/3/16


I've found this afternoon a solution. It's a question of "structure". For my explication, i have simplified the code.

Before, i made that:
for ($i=0$i<$nbvar,$i++) {
   
$_SESSION["var['contact'][$i]"]=$value1[$i];
   
$_SESSION["var['adresse'][$i]"]=$value2[$i];
}

//and for desrtroy

unset($_SESSION["var['contact']"]);
unset(
$_SESSION["var['adresse']"]);

// but that doesn't work


But now i do that:

for ($i=0$i<$nbvar,$i++) {
   
$var["$i"]['contact']=$value1[$i];
   
$var["$i"]['adresse']=$value2[$i];
}

$_SESSION['var']=$var;

//and for desrtroy

unset($_SESSION["var"]);

// and that work :-D

Login

Who's Online

219 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 219


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits