file_put_contents生成ansi文件
$line_body = array('张三','李四','王五'); $line_body = array_map(function ($element){return iconv('UTF-8','GBK',$element);}, $line_body); //汉字转码 $body[] = implode("\t", $line_body)."\r\n"; file_put_contents('./test_gbk.txt', $body);