Assign Javascript Variable Value to PHP Variable

Hi guys Today, I will tell you through this tutorial how you can get the variable of javascript in php variable value.
First of all, you can create a php file. You can keep any name for this file.


var myJavascriptVar = '123456';
document.cookie = "myJavascriptVar = " + myJavascriptVar </script>

echo $myPhpVar= $_COOKIE['myJavascriptVar'];