It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center。
已关闭8年。
我想将JavaScript变量添加到php echo中
谢谢 PHP在服务器上运行,并输出一些文本。 文本发送到浏览器 浏览器将文本解释为HTML / JavaScript / etc
在执行JavaScript时,PHP已完成运行。
如果要传回数据,则需要发出一个新的 HTTP请求,并从头开始运行PHP脚本。
已关闭8年。
我想将JavaScript变量添加到php echo中
arr[i]='<?php echo $winner[javascript variable]; ?>';
谢谢
最佳答案
你不能
在执行JavaScript时,PHP已完成运行。
如果要传回数据,则需要发出一个新的 HTTP请求,并从头开始运行PHP脚本。