how to store value of javascript variable in php variable code example
Example 1: how to assign value of a js variable to a php variable
<script> document.cookie = "myJavascriptVar = " + myJavascriptVar </script>
<?php
$myPhpVar= $_COOKIE['myJavascriptVar'];
?>
Example 2: javascript variable store in php
<script>
var a="Hello";
</script>