[PHP] Add to array problem

2005-05-16 Thread mayo
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

RE: [PHP] Add to array problem

2005-05-16 Thread Shaw, Chris - Accenture
] = banana [2] = apple [3] = raspberry ) Chris. -Original Message- From: mayo [mailto:[EMAIL PROTECTED] Sent: 16 May 2005 15:26 To: php Subject: [PHP] Add to array problem 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

RE: [PHP] Add to array problem

2005-05-16 Thread Murray @ PlanetThoughtful
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

Re: [PHP] Add to array problem

2005-05-16 Thread Chris
If you're doing: $items=array(); before each array_push() call, that is emptying the array, then pushing the value onto the empty array. 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().

RE: [PHP] Add to array problem

2005-05-16 Thread Mark Rees
-Original Message- From: mayo [mailto:[EMAIL PROTECTED] Sent: 16 May 2005 15:26 To: php Subject: [PHP] Add to array problem 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(); Looking

Re: [PHP] Add to array problem

2005-05-16 Thread Marek Kilimajer
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

Re: [PHP] Add to array problem

2005-05-16 Thread Petar Nedyalkov
On Monday 16 May 2005 17:26, 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]); Don't assign the result of the array_push() function

Re: [PHP] Add to array problem

2005-05-16 Thread Arshavir Grigorian
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 I am having a similar problem: if (!