取消换行就是这个代码:
<?php
$file_content=file_get_contents("某个HTML页面文件名");//打开HTML文件(生成后的)
$file_content=str_replace("\n","",$file_content);//删除掉换行
?>
<?php
$file_content=file_get_contents("某个HTML页面文件名");//打开HTML文件(生成后的)
$file_content=str_replace("\n","",$file_content);//删除掉换行
?>
<?php
$file_content=file_get_contents("某个HTML页面文件名");//打开HTML文件(生成后的) $file_content=str_replace("\n","",$file_content);//删除掉换行,重点是这句,如果你是在生成时取消,用这个话就可以了
file_put_contents("某个HTML页面文件名",$file_content);//写入文件
?>
<?php
$file_contents=file("某个文件名");
for($i=0,$end=count($file_contents)-1;$i<=$end;$i++)
{
$file_contents[$i]=rtrim($file_contents[$i]);//去掉空格和换行
}
file_put_contents("某个文件名",$file_contents);
?>