JavaScript variable value to a PHP
<p>I know that the following question has been asked many times:</p>

<pre><code>&lt;script&gt;
  var myVar = 123;
  &lt;?php $what_is_myVar = myVar ; ?&gt;
&lt;/script&gt;
</code></pre>

<p>My searching results for this question were: </p>

<ul>
<li>PHP runs on the server, JavaScript runs on the client…</li>
<li>Need to use Ajax to pass a JS value...</li>
<li>This code will never work you…</li>
<li>Need to set hidden field value…</li>
<li>Use $_GET[]…</li>
</ul>

<p>I tried the following, but that didn’t work:</p>

<pre><code>&lt;?php $what_is_myVar = "&lt;script&gt;document.write(myVar)&lt;/script&gt;"; ?&gt;
</code></pre>

<p>I couldn’t find anywhere a complete short solution in order to pass the value of <code>myVar</code> into <code>$what_is_myVar</code></p>

<p>Please can anyone help me on this issue,</p>
