array_push but with key, value pairs
| From: | Joseph Blythe | Date: | Tue, 17 Apr 2001 05:13:27 +0000 |
| Subject: | array_push but with key, value pairs | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-48891@lists.php.net to get a copy of this message | ||
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 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 ;-)
What I am really trying to do is create a new array from the HTTP_POST_VARS while excluding certain fields, like Submit or the X and Y values from a image button.
Any ideas/suggestions are very welcomed,
Regards
Joseph,