note 119735 added to function.array-keys

From: Date: Mon, 15 Aug 2016 07:07:15 +0000
Subject: note 119735 added to function.array-keys
Groups: php.notes 
Request: Send a blank email to php-notes+get-206285@lists.php.net to get a copy of this message
To pick every keys in a $_POST, set the post to a variable then use it as an Indexed arrays. For example, <?php //Assuming the post value is has 3 fields name, age, address $postvalue = array_keys($_POST); echo $postvalue[0]; print "\n"; echo $postvalue[1]; print "\n"; echo $postvalue[2]; ?> The result will be name age address PS: Trying to access array_keys($_POST[0]) doesn't work in this case. ---- Server IP: 64.71.164.2 Probable Submitter: 90.191.43.102 ---- Manual Page -- http://php.net/manual/en/function.array-keys.php Edit -- https://master.php.net/note/edit/119735 Del: integrated -- https://master.php.net/note/delete/119735/integrated Del: useless -- https://master.php.net/note/delete/119735/useless Del: bad code -- https://master.php.net/note/delete/119735/bad+code Del: spam -- https://master.php.net/note/delete/119735/spam Del: non-english -- https://master.php.net/note/delete/119735/non-english Del: in docs -- https://master.php.net/note/delete/119735/in+docs Del: other reasons-- https://master.php.net/note/delete/119735 Reject -- https://master.php.net/note/reject/119735 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206285) next »