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
Post a Comment