Home > Backend Development > PHP Problem > How to write newline to file in php

How to write newline to file in php

hzc
Release: 2023-03-01 11:48:02
Original
5431 people have browsed it

How to write newline to file in php

The way PHP writes files with line breaks

It is not possible to add "\r\n" directly after the string;

Just add ."\r\n" after writing the variable $filename

file_put_contents($filelist, $filename."\r\n",FILE_APPEND);
Copy after login

Recommended tutorial: "PHP Tutorial"

The above is the detailed content of How to write newline to file in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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