1.选择二进制方式重新下载
2.将每行的换行符替换为空字符串
public function formatWenJian(){
//http://127.0.0.1/index.php/home/test/formatWenJian?path=http://127.0.0.1/application/admin/view2/order/import_order.html
$path = input('path');//application/admin/view2/pickup/add.html
$cun_path = 'D:/xampp/htdocs/www/tanshop/public/robots.txt';//保存在 public/robots.txt
$resource = fopen($path,'r');
if(!$resource)
die('输入正确路径');
$str = '';
while (!feof($resource)){
$hang = fgets($resource);
$str .= str_replace("\r\n","",$hang);
}
fclose($resource);
file_put_contents($cun_path, $str);
}