array help
| From: | AJDIN BRANDIC | Date: | Tue, 10 Oct 2000 15:41:25 +0000 |
| Subject: | array help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19367@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to add an element to an array each time someone clicks on a
button or page is reloaded. I'm using php4 and array_push doesn't seam
to work the way Perl's array_push does.
if ($submit) {
array_push ($basket, $counter);
$counter++;
}
First I cannot just do $basket = array(); to declare the array but have
to do $basket=array(0);. Is there a way arround this?
The problem with the above code is that new $counter value replaces old
$counter value at array position 1 and the array never grows.
Can someone tell me how to do this.
Thanks
Ajdin