how to pass these strings from php to javascript

后端 未结 5 1597
轮回少年
轮回少年 2020-12-20 07:25

i have 4 strings in my application like this that i want to pass to my js file

$a1=\'[10,20,13,14]\';
$a2=\'[17,15,14,16]\';
$a3=\'[18,24,16,17]\';
$a4=\'[15         


        
5条回答
  •  一整个雨季
    2020-12-20 08:09

    Use json_encode on the php side and pass the data back that way http://us3.php.net/manual/en/function.json-encode.php

提交回复
热议问题