各位大佬帮忙看看哈,PHP获取内容生成TXT乱码
应该在哪里加上utf8,name=Content-Disposition: attachment; 我在这里加都是出错的class Download extends Base{ public function index(){ $id=$this->request->param('id'); $order='id asc'; $limit=''; $page=false; $info=model('common/api')->novel_detail($id); $chapter_list=model('common/api')->get_chapter_list($id, $order, $limit, $page); $br = "\r\n"; echo "《".$info['title']."》".$br.$br; echo " 简介:".str_replace(array(" ","<br />"), array(" ","$br"),$info['content'])."".$br; //var_dump($info); header("Content-Type: application/octet-stream"); header ( "Content-type:text/plain" );header( "name=Content-Disposition: attachment; file".$info['title'].".txt" );
foreach ( $chapter_list as $key => $chapter1) { set_time_limit(0);ignore_user_abort(true); $chapter=model('common/api')->get_chapter($info['source_id'],$key); echo $chapter['title'].$br.$br; echo str_replace(array("<p>","<p/>"), $br,$chapter['content']).$br.$br; ob_flush( ); flush( );
bjh9527
发表于 2022-10-25
这个是采集规则吧
评论列表
加载数据中...
amuwap
发表于 2022-10-25
不是
@bjh9527评论列表
加载数据中...
wuqing
发表于 2022-10-25
你这是想做下载啊,靠你这种方法下载的时候生成行不通小说都是几千章的换个思路吧
评论列表
加载数据中...
amuwap
发表于 2022-10-25
也是
@wuqing评论列表
加载数据中...