Posted by Marek Kilimajer on 05/16/05 18:45
mayo wrote:
> 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.
>
> thx
>
>
array_push() returns the number of elements in the array, not the array
itself. You want just:
array_push($items, $_POST["whatever"]);
Navigation:
[Reply to this message]
|