title: Passing jquery variable to php
body: <p>I have the following jquery code:</p>
  
  <pre><code>  while (count &lt; 31) {
    window['cday_' + count] = &lt;?php echo $day_1 ?&gt;; 
    window['tday_' + count] = (window['cday_' + count] * formfig) / formfig2; 
    count++;
    }
  </code></pre>
  
  <p>But I need $day_1 in the php echo statement to reflect the variable "count", so in theory it should be something like "echo $day_count".  Is it possible to pass the var to php?</p>
  
  <hr>
  
  <p>php &amp; jquery coding:</p>
  
  <pre><code>$i=0;
  while ($i &lt; $num) {
  ${"day_$i"}=mysql_result($result,$i,"datavalue");
  $i++;
  }
  
  ?&gt;
  
  &lt;script type="text/javascript"&gt;
  var chart1; 
  var count=1;
  var formfig=17;
  var formfig2=2;
  
  function chartdraw(){
  
        while (count &lt; 31) {
        window['cday_' + count] = &lt;?php echo $day_1 ?&gt;; 
        window['tday_' + count] = (window['cday_' + count] * formfig) / formfig2; 
        count++;
        }
  </code></pre>