Re: Retrieve key from $_POST
| From: | Justin Patrin | Date: | Tue, 06 Jan 2004 00:47:57 +0000 |
| Subject: | Re: Retrieve key from $_POST | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173800@lists.php.net to get a copy of this message | ||
Robin Kopetzky wrote:
Is there any way to retrieve a key value from $_POST when there is more than one $_POST array entry? I'm trying to retrieve the name of an 'INPUT TYPE="image"' control with HTML because you can't pass a value back. I need to get the name of the control to use in a 'switch' statement.Well, you can use array_keys() to get the keys of the array. You can also use foreach($_POST as $key => $value) { //do stuff here } to loop through the entire array. -- paperCrane <Justin Patrin>