creating variable name by concatenating strings in php

前端 未结 4 2246
醉梦人生
醉梦人生 2020-12-05 04:16

I have a file named questions.php with an array as follows :

$question12 = array(\"Which is the tallest mountain\",\"Mt Everest\");

I am in

4条回答
  •  情歌与酒
    2020-12-05 04:52

    Variable variable is not recommended, but the answer is below:

    $question = ${'question'.$var}[0];
    

提交回复
热议问题