第一种:
代码如下:
$content=str_replace("\n","",$content);
echo$content;
或者:
$content=str_replace(array("\n","\r"),"",$content);
第二种:
$content=preg_replace("/\s/","",$content);
第三种:
$content=trim($content);
下一篇:php列出mysql表所有行和列的方法