如何使用图像将多维数组从php传递到ajax jquery

如何使用图像将多维数组从php传递到ajax jquery,php,jquery,ajax,Php,Jquery,Ajax,我不知道如何将$行传递给ajax。($行包含2行和4列以及2个图像)。请帮助。您好,您可以通过以下方法完成此操作 $.ajax({ type: 'POST', url: 'demo.php', dataType: 'json', success:function(result) { $obj[] = JSON.parse(result); $('#id1').html($obj[1][1]); $('#name1').html($obj[1][2]); php file:=> while(

我不知道如何将$行传递给ajax。($行包含2行和4列以及2个图像)。请帮助。

您好,您可以通过以下方法完成此操作

$.ajax({
type: 'POST',
url: 'demo.php',
dataType: 'json',
success:function(result)
{
$obj[] = JSON.parse(result);
$('#id1').html($obj[1][1]);
$('#name1').html($obj[1][2]);
php file:=>
while($row = mysqli_fetch_array($result, MYSQLI_BOTH)){
$rows[] = $row; }
echo json_encode($rows);
$.ajax({

type:'POST',
url:'demo.php',
数据类型:“json”,
成功:功能(数据)
{

对于(i=0;ido console.log(data))after success函数,在这里发布您的数据,以便我能够理解ClearyJSON文件包含真实图像…而不仅仅是字符串
var object = {};
object.id = 34;

JSON.stringify(obj);
type: 'POST',
url: 'demo.php',
dataType: 'json',
success:function(data)
{
    for(i=0; i<data.length; i++){
        $('#id1').html(data[i].obj);
    }
}