(我的条件可能不正确(也许我为什么在谷歌没有结果),所以请随时改正我的条件)。
我需要改变一个输出的数组
{"Source":["BKD060818","BKD060818",],"Qty":["15","23"],"ISBN":["9780805079333","9780143118978",],
"Title":[" "," ",],"Author":["Boyle","Thurston Clarke"],"Price":["2.50","3.43"],
"Guide":["a","f",]}
到
{"Source":"BKD060818","Qty":15, "ISBN":"9781452128450", "Title":" ","Author":"Boyle","Price":"2.50","Guide":"a"},
{"Source":"BKD060818","Qty":23, "ISBN":"9780143118978", "Title":" ","Author":"Thurston Clarke","Price":"3.43","Guide":"f"}
代码
if(!empty($guides)){
foreach($guides as $key=>$value) {
$isbn10Array[$i] = $row['isbn10'];
$isbn13Array[$i] = $row['isbn13'];
if(!empty($value)) {
$guideArray[$i] = $key;
$qtyArray[$i] = $value;
switch ($guideArray[$i]) {
}
$guideRefArray[$i] = $guideRef;
$poArray[$i] = $po;
$i++;
}
}
}
}
$ships = array('Source'=>$poArray,
'Qty'=>$qtyArray,
'ISBN'=>$isbn13Array,
'Title'=>$titleArray,
'Author'=>$authorArray,
'Price'=>$PriceArray,
'Guide'=>$guideArray,
);
$ships输出我现在看到的是将它移动到
$decision[$i] = array('Source'=>$po,
'Qty'=>$qty,
'ISBN'=>$isbn13,
'Title'=>$title,
'Author'=>$author,
'Price'=>$Price,
'Guide'=>$guide,
);