Get a PHP var with other PHP var -


i know title not describing problem well, explain here: have multiple $_post similar names, question1,question2,question3...

i have loop $i. want vars ($question1, $question2), in $i. example:

$question.$i = $_post['question' . $i]; 

i want because number of questions variable, have button add questions , answers page , submit it.

first, need make explicitly $question array. build $_post index concatenating string , $i ..

so, before loop:

$question = array(); 

and in loop:

$question[$i] = $_post['question'.$i]; 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -