本文转自IT摆渡网欢迎转载,请标明出处。
更多php文章请阅读
PHP按行读取文件 去掉换行符”\n”:
第一种:
$content=str_replace("\n","",$content);
echo $content;
或者:
$content=str_replace(array("\n","\r"),"",$content);
第二种:
$content=preg_replace("/\s/","",$content);
echo $content;
第三种:
$content=trim($content);
阅读了这篇文章的人还阅读了
php把HTML代码转换成文本输出的方法
如何设置访问index.php/index.html的时候自动切换到顶
提供PHP问题错误修改服务
PHP出现错误的查错方法总结