I encountered a problem today that when using fwrite to write a txt file, I can’t use rn to wrap the line
I tried for a long time but couldn’t find a solution!
Suddenly I thought of something I had seen in a book before, but I still used this thing. Solved!
Write it now to prevent forgetting in the future and hope it can help friends who need help!
Look at the code directly:
Copy code The code is as follows:
$stream = fopen("robots.txt", "w+");
fwrite($stream, "you Have you changed the line?rnI have already changed the line!");
?>
http://www.bkjia.com/PHPjc/328146.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/328146.htmlTechArticleI encountered a problem today. When using fwrite to write a txt file, using rn cannot wrap the line. I tried for a long time but couldn’t find it. Way! Suddenly I thought of something that I saw in a book before but still used this...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn