How do I convert a string to an array name (php)?
<p>I have 4 arrays, each with a question and answer. I want to select a random question/answer array. Here is my code:</p>

<pre><code>&lt;?php
$query_1 = array("What is two plus three?", "5");
$query_2 = array("What is four plus two?", "6");
$query_3 = array("What is seven plus one?", "8");
$query_4 = array("What is six plus three?", "9");

$rand_key = rand(1,4);
$current_query = ('$query_'.$rand_key);
$question = $current_query[0];

print $question;
?&gt;
</code></pre>

<p>$question simply prints "$" rather than the first element of the array. How do I get $question to print the first element of the array?</p>

<p>-- yes, I'm a php noob.</p>
