我想弄清楚,如果我能做到一个数组while循环内的数组?
while($row = $retail -> fetch(PDO::FETCH_ASSOC)){
$json['data'][] = array(
'id'=>$row['idretailers'],
"category"=>$row['category'],
"headline"=>$row['headline'],
'price'=> array ("full_price" => $row['price']),
'description'=>$row['description'],
"comments" => array(
while($row_c = $comments -> fetch(PDO::FETCH_ASSOC)){
// more items
})
);
}
有意见中的while循环while循环,这可能吗?
谢谢!
你试过了吗? –
只需尝试一下,看看你会得到一个语法错误,并尝试一种不同的方法。短:不,这是不可能的。 – Yoshi
它的可能,除非你尝试 – Khurram