creating variable name by concatenating strings in php

前端 未结 4 2252
醉梦人生
醉梦人生 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 05:16

    Just use $question12[0]. It will give you the desired output.

    Using the $var you can do it like this:-

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

提交回复
热议问题