Re: $_GET of array variables
| From: | Jochem Maas | Date: | Wed, 05 Jan 2005 23:02:29 +0000 |
| Subject: | Re: $_GET of array variables | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37987@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
in the script that recieve the form submission try adding the following lines to view the contents of the $_GET superglobal array. echo '<pre>'; print_r( $_GET );tip for those pulling their hair out: PRINT_R() is your friend!!! ...sometimes referred to as the poormans debugger. now lets sing together: "If in doubt print it out!" :-)
echo '</pre>'; once you see the structure it should be clear what array index key(s) you should be using to get to the relevant values. PS - Matt M.'s syntax suggestion is along the right lines (although the actual keys you use may be different. Matt M. wrote:$_GET['simplevariable'] but am not having much luck with anything like: $_GET["arrayvariable$a"] (1-dimensional array) or $_GET["arrayvariable$a$b"] (2-dimensional array) (I've tried several other odd syntaxes such as $_GET["arrayvariable[$a][$b]"]. Also it's not an \" situation.)have you tried $_GET["arrayvariable"][$a] or $_GET["arrayvariable"][$a][$b]