note 29527 added to function.session-register
| From: | webmaster at sejoursaucanada dot com | Date: | Sun, 16 Feb 2003 17:12:03 +0000 |
| Subject: | note 29527 added to function.session-register | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44057@lists.php.net to get a copy of this message | ||
For register array data in session :
create your table (ex) :
$table[0]="data 0";
$table[1]="data 1";
$table[2]="data 2";
and you have to only register the array and not the array data :
session_register("table");
and NOT :
session_register("table[0]");
session_register("table[1]");
session_register("table[2]");
after that for to display datas, write :
echo $table[0];
echo $table[1];
echo $table[2];
and NOT :
echo $_SESSION["table[0]"];
echo $_SESSION["table[1]"];
echo $_SESSION["table[2]"];
I don't know why, but it's alright like that ;o)
xav
--
http://www.php.net/manual/en/function.session-register.php
http://master.php.net/manage/user-notes.php?action=edit+29527
http://master.php.net/manage/user-notes.php?action=delete+29527
http://master.php.net/manage/user-notes.php?action=reject+29527