I’m curious, more than anything – is it possible to get a PHP value posted? i.e. $_POST['foo'] via some kind of indexing? i.e. $_POST[0]?
($_POST[0] does not work by the way)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it’s not possible: you cannot fetch values from an associative array by numeric indexes (because, as clearly noted in the doc, PHP does not distinguish between indexed and associative arrays).
That’s why some functions (PDOStatement::fetch and its siblings, for example) that return arrays take an additional param to control the ‘type’ of indexes in the array returned: numeric (
FETCH_NUM), string (FETCH_ASSOC) or both (FETCH_BOTH, the default value). )The closest you might get with reindexing: