passing array from php to javascript

前端 未结 3 1691
再見小時候
再見小時候 2021-01-25 02:18

Hello I\'m trying to pass several arrays from php to javascript. For some of them it works, for others not. I get an array of filenames and an array which contains the content o

3条回答
  •  误落风尘
    2021-01-25 02:38

    The problem is already solved for you. Use json_encode instead.

    print('filesArray = '.json_encode($filesArray));
    

    Note that json_encode demands that your data is utf8 encoded. But you should do that already anyway.

提交回复
热议问题