title: Get Javascript Variable value in PHP variable
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    var val;
      $('select').on('change', function() {
          alert( this.value );
          val = this.value;
      })
      
      &lt;?php
  echo $variable = "&lt;script&gt;document.write(val)&lt;/script&gt;";
  ?&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select&gt;
      &lt;option value="1"&gt;One&lt;/option&gt;
      &lt;option value="2"&gt;Two&lt;/option&gt;
      &lt;option value="3"&gt;Three&lt;/option&gt;
      &lt;option value="4"&gt;four&lt;/option&gt;
  
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to get the value of the selected box and save it in a PHP variable. I want to save and echo <code>val</code> variable. Please help</p>