Php 访问分块数组中的数据

Php 访问分块数组中的数据,php,jquery,arrays,json,multidimensional-array,Php,Jquery,Arrays,Json,Multidimensional Array,我在PHP中用函数array_chunk分割一个大数组,然后用json_encode将结果数组转换为json。我的回答是: [["nombre","apellido","flor","animal","ciudad","cosa"],["nombre","apellido","flor","animal","ciudad","cosa"],["nombre","apellido","flor","animal","ciudad","cosa"]] //rest of the ajax func

我在PHP中用函数array_chunk分割一个大数组,然后用json_encode将结果数组转换为json。我的回答是:

[["nombre","apellido","flor","animal","ciudad","cosa"],["nombre","apellido","flor","animal","ciudad","cosa"],["nombre","apellido","flor","animal","ciudad","cosa"]]
//rest of the ajax function...
success: function(data) {
$("#resultados").append("<tr><td>"+data[0]+"</td><td>"+data[1]+"</td><td>"+data[2]+"</td><td>"+data[3]+"</td><td>"+data[4]+"</td><td>"+data[5]+"</td><td>"+data[6]+"</td><td>"+data[7]+"</td><td>"+data[8]+"</td><td>"+data[9]+"</td><td>"+data[10]+"</td></tr>");
}
现在,我想通过ajax获得数组数组,并将每个项放在表的一列中

通常,如果我只得到一个数组,我会这样做:

[["nombre","apellido","flor","animal","ciudad","cosa"],["nombre","apellido","flor","animal","ciudad","cosa"],["nombre","apellido","flor","animal","ciudad","cosa"]]
//rest of the ajax function...
success: function(data) {
$("#resultados").append("<tr><td>"+data[0]+"</td><td>"+data[1]+"</td><td>"+data[2]+"</td><td>"+data[3]+"</td><td>"+data[4]+"</td><td>"+data[5]+"</td><td>"+data[6]+"</td><td>"+data[7]+"</td><td>"+data[8]+"</td><td>"+data[9]+"</td><td>"+data[10]+"</td></tr>");
}
//ajax函数的其余部分。。。
成功:功能(数据){
$(“#resultados”)。追加(“+数据[0]+”“+数据[1]+”“+数据[2]+”“+数据[3]+”“+数据[4]+”“+数据[5]+”“+数据[6]+”“+数据[7]+”“+数据[8]+”“+数据[9]+”“+数据[10]+”);
}
其中“resultados”是表行的ID

我想把每个数组的数据放在一个不同的表中,这样我就可以访问这些数组的索引了

    //rest of the ajax function
    success: function(data){
        //we access first array and then inner
        $.each(data,function(index,value){
            // now we access inner arrays
            $.each(data[index],function(index2,value2){
                //here you do what you had to do
                //data[index][index2] equals value2
            });
        });
    }
可能是这样

    //rest of the ajax function
    success: function(data){
        //we access first array and then inner
        $.each(data,function(index,value){
            // now we access inner arrays
            $.each(data[index],function(index2,value2){
                //here you do what you had to do
                //data[index][index2] equals value2
            });
        });
    }
像这样像这样