Silly varible question
| From: | Ed Curtis | Date: | Thu, 13 Jul 2006 12:52:46 +0000 |
| Subject: | Silly varible question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-239406@lists.php.net to get a copy of this message | ||
I know this is probably simple as all get out but it's early and I can't
find an answer anywhere after searching for a while....
I need to assign a number to a variable and then use that variable in a
session to store an array. It's for a shopping cart system I'm building.
What I've got is:
$count = 1; //First item in the cart passed from form to form
$item = array();
$item[] = $_POST['phone'];
$item[] = $_POST['category'];
$item[] = $_POST['copy'];
$item[] = $_POST['pic_style'];
$item[] = $cost;
$item[] = $image;
session_register('item');
In the session the item is known as 'item'. What I need for it to be is
'item1' so when the customer chooses another product I can increase $count
by 1 and have the next array with values stored as 'item2'.
Thanks for any help,
Ed