PHP reads the file line by line and removes the newline character "n":
First type:
Copy code The code is as follows:
$content=str_replace("n","",$content ; (array("n","r"),"",$content);
Second type:
Copy code Code As follows:
$content=preg_replace("/s/","",$content);
echo $content;
Third type:
Copy code The code is as follows:
$content=trim($content);
http://www.bkjia.com/PHPjc/764614.htmlwww.bkjia.com
true
http: //www.bkjia.com/PHPjc/764614.htmlTechArticle
PHP reads the file line by line and removes the newline character "n": Type 1: Copy the code The code is as follows: $content =str_replace("n","",$content); echo $content; Or: Copy the code as follows: $...