note 34155 deleted from faq.html by philip

From: Date: Wed, 10 Sep 2003 19:43:41 +0000
Subject: note 34155 deleted from faq.html by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-56038@lists.php.net to get a copy of this message
Note Submitter: nick ABaCADabRA itomic com ---- Nested arrays are handled properly by php, when posted from a html form. Quoting keys in associative arrays in a html form results in different results than if you quote an associative key in php code. i.e. try this: <?php $var2["asdf"] = "asdlfjasdf"; if ($_GET['action'] == 'do') { echo "<pre>\nPosted var"; print_r($_POST['var']); echo "php defined var"; print_r($var2); echo "\n</pre>\n"; } ?> <html> <body> <form action='?action=do' method='post'> <input name='var[]' /><br> <input name='var[]' /><br> <input name='var["asdf"][]' /><br> <input name='var["asdf"]["asdf"]' /><br> <input type='submit' /> </form> </body> </html> the posted var with the double quoted associative keys are interpreted differently than the php-defined associative keys (which are also quoted)

« previous php.notes (#56038) next »