note 40071 added to function.array
| From: | scott at ipbfree dot com | Date: | Fri, 20 Feb 2004 20:04:44 +0000 |
| Subject: | note 40071 added to function.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65456@lists.php.net to get a copy of this message | ||
Pass an array using sessions.
<?php
$a = array('hello', 'hello2', 'hello3');
$c = count($a);
foreach($a as $a => $b) {
for($x=0; $x<$c; $x++) {
$_SESSION['name'][$a] = $b;
}
}
print_r($_SESSION);
?>
Output:
Array ( [name] => Array ( [0] => hello [1] => hello2 [2] => hello3 ) )
----
Manual Page -- http://www.php.net/manual/en/function.array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40071
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40071&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40071&report=yes
Search -- http://master.php.net/manage/user-notes.php