<script type="text/javascript"> var slist = '<?php echo urlencode(json_encode($data['arr']));?>'; var list = eval(decodeURIComponent(slist)); drawGpsMap(list); </script>
cannot be passed directly, but you can use js ajax to dynamically call the php array value when the page is loaded
or assign the array value processed with php as a string to the html hidden control first, and then use js code to call hidden value
In addition, I think that if your data does not change frequently, it is better to use php to generate a .js file that defines the array and then file it.
Is this what you said?