How to use the value of one variable when checking the existence of another
<p>I want to be able to check the existence of up to, but often less than, 6 consecutively named variables using a FOR loop thus:</p>

<pre><code>for ($i = 0; $i &lt;= 5; $i++) {
   $vartocheck = "$var_".$i;
   if ($vartocheck) {
      echo $vartocheck." exists!";
   }
}
</code></pre>

<p>Now I know the above doesn't work but I can't figure out how to reference and check the existence of $var_0 through to $var_5 by using the value of $i.</p>

<p>I have tried isset and call_user_func to construct and return the variable name I am after but I have had no success thus far.</p>

<p>I am trying to avoid an eval statement.</p>
