PHP convert form textarea line break code_PHP tutorial

WBOY
Release: 2016-07-13 10:54:23
Original
914 people have browsed it

After my test form textarea line break, it is rn under windows and n under linux (this is not true

test), in addition, under win, r and n both have line-breaking functions

Table 6-1. Escape characters

Sequence
Meaning

n
newline (lf or ascii character 0×0a (10))

r
carriage return (cr or ascii character 0×0d (13))

t
Horizontal tab character (ht or ascii character 0×09 (9))


Backslash

$
Dollar sign


Double quotes

[0-7]{1,3}
This regular expression sequence matches a character represented in octal notation

x[0-9a-fa-f]{1,2}
This regular expression sequence matches a character represented in hexadecimal notation


Summary: Many friends say that the newline code n in textarea is like this str_replace("n","

/>”), but we don’t know that this is not the standard line break of window. We should change it to str_replace

("nr","
")This is KO.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632330.htmlTechArticleAfter my test form textarea line break, it is rn under windows and n under linux (this has not been tested ), in addition, under win, r and n both have line wrapping functions Table 6-1. Escape character sequence meaning n line wrapping...
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