【发布时间】:2026-02-24 10:20:06
【问题描述】:
**$sql = 'select * from dish_category';
$results =$conn->query($sql);
$spots = array(); //array to parse jason from
while($spot = $results->fetch_assoc()){
$spots[] = $spot;
}
foreach($spots as $key=>$value){
$newArrData[$key] = $spots[$key];
$newArrData[$key]['Cat_Image'] = base64_encode($spots[$key]['Cat_Image']);
}
header('Content-type: application/json');
echo json_encode($newArrData);**
以上是 PHP 代码,它运行良好并返回 JSON 字符串,现在我很困惑如何在 android 中解析图像(解码 base64)?
【问题讨论】: