title: increment php variable in javascript function
body: <p>Can anyone tell me how to increment a php variable inside a javascript function.I have a javascript function which is called for every 3 seconds inside this function i need to increment the php variable.</p>
  
  <pre><code>&lt;? php $k =0?&gt;
  function slide()
  {
   //increment $k
   var j =&lt;? php echo $k++; ?&gt;//when I do this k is not incremented
  }
  </code></pre>
  
  <p>Can anyone tell me where I went wrong?Is their any other alternative to do this?</p>
  
  <p>Thanks,</p>
  
  <p>Shruti</p>