PHP generates an array and then transmits it to js. php generates an array js
<Script type = "text/javascript"> var slist = '<? Php echo urlencode (json_encode ($ data ['arr']);?> '; Var list = eval (decodeURIComponent (slist); drawGpsMap (list); </script>
How to pass the php array value to the javascript array?
Cannot be passed directly, but php array values can be dynamically called during page loading using js ajax.
Or assign the array value processed by php to the html den control first, and then use js Code to call the value of hidden.
In addition, I think it is better to use php to generate a. js file if your data does not change frequently. This file defines the array and then file the file.
How to pass the values in the PHP array to JS
<Script type = "text/javascript"> flowplayer ("player2", "./templates/flowplayer-3.2.15.swf", {clip: {url: "<? Php echo $ row ['address'];?> ", I want to replace this address with the Database Value autoPlay: false, autoBuffering: true}); </script> what do you mean?