php处理分页数据并返回json
2021-01-17 14:14
标签:mysqli list enc get host 查询 access start 字段 php处理分页数据并返回json 标签:mysqli list enc get host 查询 access start 字段 原文地址:https://www.cnblogs.com/zbl3033/p/13363809.html $row[‘itemid‘],
"itemtitle" => $row[‘itemtitle‘],
"image" => $row[‘itempic‘],
"price" => $row[‘orderfee‘]//
);
//总页数等于总记录数/页容量,向上取整, 如3.5页,要有第四页
$totalPage = ceil($row[‘total‘] / $pageSize);
array_push($pageList, $items);//填充分页数据
}
mysqli_close($conn);//关闭连接
echo json_encode($pageList,JSON_UNESCAPED_UNICODE);
?>