如何在php代码中的javascript代码中使用php变量?

海绵宝宝

我该如何实现:

<?php
    echo "<script type='text/javascript'>";
    echo "document.getElementById('table_apps').innerHTML = json_encode($td_temp);";
    echo "</script>";
?>

$ td_temp有问题;

南比

json_encode() 是一个PHP函数

像这样

echo "document.getElementById('table_apps').innerHTML ='".json_encode($td_temp)."';";

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章