How to call the php function in js, js passes in the variable, and the php function returns it to the js variable after processing. I can't read what I wrote. , error report,. It's OK to apply script to PHP, but it won't work if you apply script to PHP. . Specifically, I want to know how to directly transfer variables
"; return $c.'---8888'; } ?>
var a='1001';
var op='666';
od="document.write(op)'; echo jia($b);
##echo 'a variable:'.$b; function jia($c){ return $c.'---8888'; } ?> I mainly want to get the js variables in js and return them after execution in php. . .If you want to pass a value, you can use session
As I told you, the PHP code is executed first
The op variable is not defined in PHP
Parse PHP first, then parse JS