js获取php变量的实现代码

  例如下面一段j代码:

  

复制代码 代码如下:

  <script type="text/javascript">

  var arr="<?php echo $arr;?>"

  </script>