RE: Add to array problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I'm having a little problem adding to an array. Each time I add to an
> array it wipes what was previously added. I'm using array_push().
> 
> $items=array();
> $items=array_push($items, $_POST["whatever"]);
> 
> I'm missing something easy.

Try:

$items=array();
array_push($items, $_POST["whatever"]);

In other words, remove the "$items=" in front of "array_push(...."

Regards,

Murray

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux