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

<script type="text/javascript">
  var slist = '<?php echo urlencode(json_encode($data['arr']));?>';
  var list = eval(decodeURIComponent(slist));
  drawGpsMap(list);
</script>

相关推荐