Conversion of php multidimensional array to javascript array

This question already has an answer here:

  • Returning JSON from a PHP Script 15 answers

  • You shouldn't be print_r() your arrays as this it produces human readable output, nothing JS can deal with easily nor out of the box. Instead you should use ie JSON and pass your arrays in that form to JS:

    echo json_encode($my_array, JSON_UNESCAPED_UNICODE);
    
    链接地址: http://www.djcxy.com/p/45820.html

    上一篇: 从PHP脚本返回JSON

    下一篇: 将php多维数组转换为javascript数组