Questions about Enter when PHP writes to a text file
Today, when writing a log file, it is found that the content written is not wrapped. Some information was found to find some problems.
?
The relevant code is as follows:
?
File_put_contents ($_session[' projectname '), ' balance sheet written successfully \ r \ n ', file_append);
?
Or
?
$fp = fopen (' Log.txt ', ' a '); Fwrite ($fp, ' balance sheet Write success \r\ntest '); fclose ($FP);
?
The code is not a problem, but after writing the file, \ r \ n will output directly instead of the carriage return.
?
But Windows under \ r \ n really represents a carriage return, and there is no error, depressed for a good while,
?
Later, I changed the quotation marks enclosed in strings from single quotes to double quotes, and everything was OK.
?
Seemingly small differences, but the results are unexpected.
?
Although it is unclear what the reason is, but still record
?