A brief analysis of the problem that rn cannot be used to wrap lines when writing txt files with php fwrite_PHP Tutorial

WBOY
Release: 2016-07-21 14:59:27
Original
1234 people have browsed it

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!");
?>

www.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...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!