3
在我的系統中,我已經獲取所有數據並導出到txt文件中。PHP頭問題
$str_res_exp = $this->export_res($column ,$res_data,$column_length);
header("Content-type: plain/text");
header("Content-Disposition: attachment; filename=".$_POST['txt_name'].".txt");
header("Pragma: no-cache");
header("Expires: 0");
echo $str_res_exp;
exit;
它顯示的數據,但是,但是,第一行,第一個字符它填補空白......
由於安全原因,我不能發佈更多的代碼。
是的,你可以發佈更多的代碼,只是放入一些示例數據。我相信你的錯誤是在你的export_res方法 – Ibu
你試過'回調修剪($ str_res_exp);退出;'? –
您是否檢查過您的文檔在php標籤之前不包含任何空格?並使用@Shakti Singh的代碼作爲預防措施 –