It is best to use PHP_EOL
. This is cross-platform, so it automatically chooses the correct newline character(s) for the platform PHP is currently running on.
$stringData = "Floppy Jalopy" . PHP_EOL;
More Related Contents:
- Writing a new line to file in PHP (line feed)
- Overwrite Line in File with PHP
- PHP create file with specific name [closed]
- PHP – Failed to open stream : No such file or directory
- PHP – while loop (!feof()) isn’t outputting/showing everything
- PHP to search within txt file and echo the whole line
- Read each line of txt file to new array element
- PHP check if file contains a string
- How to read only 5 last line of the text file in PHP?
- How do I open a file from line X to line Y in PHP?
- PHP php_network_getaddresses: getaddrinfo failed: No such host is known
- Difference between file, file_get_contents, and fopen in PHP
- file_get_contents returns empty string
- How do I open a file from line X to line Y in PHP?
- remove new line characters from txt file using php
- fwrite() and UTF8
- Apache is downloading php files instead of displaying them
- Who should handle the conditions in complex queries, the data mapper or the service layer?
- Remove Text Between Parentheses PHP
- Can I rely on PHP php.ini precision workaround for floating point issue
- How to round up a number to nearest 10?
- create ini file, write values in PHP
- PHP : writing a simple removeEmoji function
- PHP exec() as Background Process (Windows Wampserver Environment)
- Access denied for user ‘homestead’@’localhost’ (using password: YES)
- Php : Convert a blob into an image file
- Include files from parent or other directory
- How to handle user input of invalid UTF-8 characters
- In PHP is it possible to inspect content of a Zip file without extracting its content first?
- Sanitizing HTML input