title: Using dynamic variables with isset()?
body: <p>I have a loop that has a dynamic variable in it, eg:</p>
  
  <pre><code>while(i &lt; 10){
    echo  ${"dynamic" . $i . "var"};
    $i++;
  };
  </code></pre>
  
  <p>I want to only echo the variable if the original var (say <code>$dynamic3var</code>) is set so I add:</p>
  
  <pre><code>while(i &lt; 10){
    if(isset(${"dynamic" . $i . "var"})){
      echo  ${"dynamic" . $i . "var"};
    $i++;
    };
  };
  </code></pre>
  
  <p>However this wont work as its still picking up <code>$i</code>.</p>
  
  <p>Does anyone know a correct way of doing this?</p>