PHP读取js变量值
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>PHP读取js变量值</title> </head> <body> <script> var a = "JonyGuan"; </script> <?php $b = 0; $b = "<script>document.writeln(a);</script>"; echo 'a变量='.$b; ?> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>PHP读取js变量值</title> </head> <body> <script> var a = "JonyGuan"; </script> <?php $b = 0; $b = "<script>document.writeln(a);</script>"; echo 'a变量='.$b; ?> </body> </html>