Re: [PHP] array_push but with key, value pairs

2001-04-17 Thread Joseph Blythe
Dean Hall wrote > Instead of 'array_push', do this: > > $input[$key] = $val; > Hey thanks dean that did the trick, I was trying: $array[] = $key . "=>" . $val which of course doesn't work hehe. Regards Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EM

Re: [PHP] array_push but with key, value pairs

2001-04-17 Thread Dean Hall
Joseph. "Joseph Blythe" <[EMAIL PROTECTED]> wrote: ... > Ok fine, I now have an associative array with a numeric index, but > hangon I wanted to push the key => value into the array. How would I do > this, I have tried a couple of things but am having some really crazy > results ;-) 'array_push'

Re: [PHP] array_push but with key, value pairs

2001-04-16 Thread Joseph Blythe
Peter Houchin wrote: > what about if you assign the key to = the id (if in a data base)? > > maybe like > > while (list ($key, $val) = each ($id)) { > if ( $key != "Submit" ) { > >>array_push($input, $val); >>} >> >> } > I am not using a database for this part as I am just collect

RE: [PHP] array_push but with key, value pairs

2001-04-16 Thread Peter Houchin
ECTED]] Sent: Tuesday, April 17, 2001 3:40 PM To: Peter Houchin Cc: [EMAIL PROTECTED] Subject: Re: [PHP] array_push but with key, value pairs Peter Houchin wrote: > maybe tring this ... > $input = array(); > > reset ($HTTP_POST_VARS); > > while ( list($key, $v

Re: [PHP] array_push but with key, value pairs

2001-04-16 Thread Joseph Blythe
Peter Houchin wrote: > maybe tring this ... > $input = array(); > > reset ($HTTP_POST_VARS); > > while ( list($key, $val) = each($HTTP_POST_VARS) ) { >if ( $key != "Submit" ) { >array_push($input, $val); >} > > } Hmm, as far as I can see this will just reset the internal pointe

RE: [PHP] array_push but with key, value pairs

2001-04-16 Thread Peter Houchin
t: Tuesday, April 17, 2001 3:13 PM To: [EMAIL PROTECTED] Subject: [PHP] array_push but with key, value pairs Hey all, I was just trying to figure out something that should be quite simple but seems to be eluding me, consider the following: $input = array(); while ( list($key, $v

[PHP] array_push but with key, value pairs

2001-04-16 Thread Joseph Blythe
Hey all, I was just trying to figure out something that should be quite simple but seems to be eluding me, consider the following: $input = array(); while ( list($key, $val) = each($HTTP_POST_VARS) ) { if ( $key != "Submit" ) { array_push($input, $val); } } Ok fine, I now have an a