note 40071 deleted from function.array by didou
| From: | didou@php.net | Date: | Thu, 17 Jun 2004 20:06:53 +0000 |
| Subject: | note 40071 deleted from function.array by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71250@lists.php.net to get a copy of this message | ||
Note Submitter: scott@ipbfree.com
----
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 ) )