Re[2]: [PHP] Comparing string to array
| From: | Richard Davey | Date: | Tue, 19 Jun 2007 18:05:02 +0000 |
| Subject: | Re[2]: [PHP] Comparing string to array | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257446@lists.php.net to get a copy of this message | ||
Hi Jim,
Tuesday, June 19, 2007, 6:21:25 PM, you wrote:
> let me try this again.
> in the submitted $_POST array, you are looking for a key (test) that contains a given $username
> that may or may not have any values set?
> Correct?
Sorry not even close.
Here, let me try again...
$param = 'test[batch1][colour][]';
(the above being a perfectly valid name for say a range of checkboxes
in a form)
Using just the above $param string, do this:
$values = $_POST['test']['batch1']['colour'];
Of course $param is a totally moving feast, and you don't know
what it may contain, only that what it does contain WILL actually be
in $_POST somewhere.
The problem was turning the string 'test[batch1][colour][]' into a
something from which you can pull the resulting values from the $_POST
array.
Cheers,
Rich
--
Zend Certified Engineer
http://www.corephp.co.uk
"Never trust a computer you can't throw out of a window"