PHP生成数组再传给js的方法

内容摘要
<script type="text/javascript">
var slist = '<&#63;php echo urlencode(json_encode($data['arr']));&#63;>';
var list = eval(decodeURIComponent(slist));
dr
文章正文
<script type="text/javascript">
  var slist = '<?php echo urlencode(json_encode($data['arr']));?>';
  var list = eval(decodeURIComponent(slist));
  drawGpsMap(list);
</script>

代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!