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);
> }
>
> }
-----Original Message-----
From: Joseph Blythe [mailto:[EMAIL PROTECTED]]
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, $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 pointer back
to the start of the HTTP_POST_VAR array, I suppose this should be done
in case I have called 'each' on the array before, but it does not answer
my question being: I want to push the key and value into an array not
just the value. I basically need array_push functionality but with the
ablility to use your own index values.
I hope this is more clear.
Regards
Joseph