Use php to do the site, it often requires the front page we interact with, sometimes we need to get the value of a variable by js php, this case in the manner in which we can embed js code to get this variable.
First we create a test php file. (Recommended Learning: PHP Programming from entry to the master)
Add code html needed inside.
We add js script inside, a definition of a variable 100.
Now we add the bottom php code, which defines a default variable b is 0, ready to use it to receive a value of the js.
Then we use the script inside writeln outputs a, and assigned to php variables in b, b to see the value in the last echo output.
Open this file directly php echo a js variable has a value of 100, this js variables in php get done in the browser.
These are the details of how php get variable values of js, php more please pay attention to Chinese networks other related articles!