$data = base64_encode('Hello World');
// echo '<pre>';
// print_r(strlen(base64_decode($data)));
// echo '</pre>';
// exit;
//strlen(base64_decode($data));
//filepath
ob_clean();
//header("Cache-Control: no-store, no-cache");
header("Content-type: text/plain");
header("Content-length: ".strlen(base64_decode($data))."");
header("Content-Disposition: attachment; filename=qwe.Lot");
exit(base64_decode($data));我想在上面的代码中从 PHP 中的字符串创建一个文件,我将它作为我的控制器。它只打印字符串但不下载文件。
如何在 Code Igniter 中从字符串创建文本文件?
更新这是浏览器调试中的输出

红糖糍粑
皈依舞
慕勒3428872
随时随地看视频慕课网APP