PHP生成数组再传给js的方法
投稿:whsnow
这篇文章主要介绍了PHP传数组给js的方法,需要的朋友可以参考下
<script type="text/javascript"> var slist = '<?php echo urlencode(json_encode($data['arr']));?>'; var list = eval(decodeURIComponent(slist)); drawGpsMap(list); </script>
关注公众号 jb51net
关闭投稿:whsnow
<script type="text/javascript"> var slist = '<?php echo urlencode(json_encode($data['arr']));?>'; var list = eval(decodeURIComponent(slist)); drawGpsMap(list); </script>