title: how to print a variable of javascript in php?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/10853630/how-to-put-javascript-variable-in-php-echo">how to put javascript variable in php echo</a>  </p>
  </blockquote>
  
  
  
  <p>I have JavaScript to get time and the code is below.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var d = new Date();
  
  var H = d.getHours();
  var m = d.getMinutes();
  if(H&gt;11)
  {
      var h = H-12;
      var a = 'PM';
  }
  else
  {
      var h = H;
      var a = 'AM';
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Now, I want to print the variables in PHP that used in JavaScript like,</p>
  
  <pre><code>&lt;?php echo $h.$m; ?&gt;
  </code></pre>
  
  <p>Is it possible?</p>
  
  <p>if yes then help me.</p>