Nothing left to worry about. I saw an article on php form conversion textarea line break on the internet. after reading the article, I feel that some information in this article is not accurate based on my past experience... as a result, I personally researched and tested the line breaks in the form data obtained by php:
The code is as follows:
PHP retrieves line breaks in form area data
$ Content = empty ($ _ POST ['content'])? Null: trim ($ _ POST ['content']);
If (! Empty ($ content) echo str_replace ("\ r", 'rl ', nl2br ($ content ));
Echo "\ r ".'
---------- Split line -------------------- '. "\ r ";
If (! Empty ($ content) echo str_replace ("\ n", 'nl ', nl2br ($ content ));
Echo "\ n ".'
---------- Split line -------------------- '. "\ n ";
If (! Empty ($ content) echo str_replace ("\ r", 'rl ', str_replace ("\ n", 'nl', nl2br ($ content )));
Echo "\ r ".'
---------- Split line ----------------------
'. "\ N ";
Echo 'hello'. "\ n". 'Boys! ';
Echo 'hello'. "\ r". 'Boys! ';
?>
Open it in the browser and enter the following in the form:
After you press submit, the browser displays the following results:
In Notepad Coco, you can see the following results:
The preceding results show that:
1. the PHP function nl2br () inserts an HTML line break before each new line (\ r \ n) in the string:
;
2. in Windows, the line feed is (\ r \ n );
3. in Notepad, \ r or has the line feed function;