Php converts the br line breaks in html to line breaks in text input. PHP has a very good function: nl2br (), which converts the line break in the text box to the br on the HTML page. but how can we convert the br line break in html to the line
a more comprehensive set of PHP tutorials , basic video and some small combat projects, below is the video directoryCD-ROM (i) \php employment Class (I.)CD-ROM (i) \php Technical exchange zone. URLCD-ROM (i) \ "Wisdom Special issue" belongs to it
PHP has a very good function: nl2br (), which converts the line break in the text box to the br on the HTML page. But how can we convert the br line break in html to the line break in the text box?
PHP has a very good function: nl2br (), which
Summary of alternative line break methods in PHP
PHP replaces the line break method summary, PHP has three ways to solve.1. Use Str_replace to replace line breaks
$str =str_replace (Array ("\ r \ n", "\ r", "\ n"), "", $str);
2. Use regular
When using the phpfwrite () function, many new users will encounter the most common but necessary solution, that is, line feed writing. We all know the linefeed of php: \ n, carriage return: \ r. when we need to change the line, we usually use the "\
PHP has a very good function: nl2br (), which converts the line feed in the text box to the & lt; br & gt; of the HTML page, but how to implement the & lt; br & gt; convert a line break to a line break in the text box. the following methods can help
Here is my solution to the problem, and finally I understand it, it's a sewer that almost capsized
1. You must know that the line break in TextArea is \ n (personal detection found that pressing ENTER is \ n, as if it were \ r \ n under Linux)
2.
Three ways to get post data from PHP
PHP image plus watermark source code
One of the simplest examples of Php+ajax+json
PHP Chinese Pinyin Source code
PHP iterates through directories, generates MD5 values for each file in the directory, and writes
PHP in the form input box to replace the return of some of the methods summarized, a friend who needs to refer to this article.
The code is as follows
Copy Code
? $str = "This is a test n";$patten = Array ("RN", "n"
Today, I encountered a textarea line feed problem in the project, which was not solved after debugging for half a day. You need to convert the carriage return text in textarea into a br and store it in the database. The following is my solution to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.