RE: [PHP] extending array
| From: | Niklas Lampén | Date: | Fri, 07 Sep 2001 10:25:11 +0000 |
| Subject: | RE: [PHP] extending array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66370@lists.php.net to get a copy of this message | ||
If you wish $shoplist[$pid] have $price in it with $units, you have to make
$shoplist a multidimensional array which is simpple:
<?
$shoplist = array();
$shoplist[$pid][$units] = "1";
$shoplist[$pid][$price] = "100";
print_r($shoplist);
?>
Try that out, it should give you the idea. You can make it even more
multidimensional if you need to.
Niklas
-----Original Message-----
From: Kristofer Thorssell [mailto:kthorssell@mpmail.net]
Sent: 7. syyskuuta 2001 12:55
To: Php-General (E-mail)
Subject: [PHP] extending array
Hi,
I want to extend an existing array.
the array is
$shoplist[$pid] = $units;
and i want to have $ price in it too.
How do I do?
/Kristofer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net