header("Content-Type: application/octet-stream");
header('Content-Disposition: attachment; filename="' . $filename . '"');
echo "test1";
echo "test1";
echo "test1";
echo "test1";
echo "test1";
echo "\r\n";这种生成方式如何生成为UTF-8格式的txt文件呢?我生成的都是ansi的
header('Content-Disposition: attachment; filename="' . $filename . '"');
echo "test1";
echo "test1";
echo "test1";
echo "test1";
echo "test1";
echo "\r\n";这种生成方式如何生成为UTF-8格式的txt文件呢?我生成的都是ansi的
echo "\xef\xbb\xbf";
$filename="test.txt";
header("Content-Type: text");
header('Content-Disposition: attachment; filename="' . $filename . '"');
echo "test1";
echo "test1";
echo "test1";
echo "test1";
echo "test1";
echo "\r\n";
不好使啊,我从数据库里取出来的UTF-8格式的汉字,生成后还是乱码啊。
echo "\xef\xbb\xbf"; 数据库汉字部分 用iconv()转
$filename="test.txt";
header("Content-Type: text");
//header('Content-Disposition: attachment; filename="' . $filename . '"');
echo "test1";
echo "test1";
echo "test1";
echo "test1";
echo "test1";
echo "\r\n";
能再详细点么,PHP不太懂