1 [这是输出] 尝试通过循环数组将 SQL 数据导出为 excel 文件,但未能导出数据的前导 0。
我曾试图在内爆中放置单引号,但仍然无法正常工作
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Type: application/vnd.ms-excel");
$user_query = mysqli_query($conn,$sql);
//echo $user_query;
// Write data to file
$flag = false;
while ($row = mysqli_fetch_assoc($user_query)) {
if (!$flag) {
// display field/column names as first row
echo implode("\t", array_keys($row)) . "\r\n";
$flag = true;
}
echo implode("\t", =array_values($row)) . "\r\n";
}
期望用单引号内爆 "\t'" 但仍然无法导出前导 0
aluckdog