In the UNIX series with \ n
In Windows series with \ r \ n
On Mac with \ r
PHP can be replaced with Php_eol to improve code-level portability
For example:Copy the Code code as follows:Echo Php_eol;The Windows platform is equivalent to echo "\ r \
There's a very good function in PHP:
NL2BR (): Converts a line break in a text box to a newline label for an HTML page。
However, how to implement the HTMLis the newline character converted to a line break in a text box?
Here are a few ways to
How PHP removes carriage return line breaks
It is known that there are several ways to use the carriage return line, but all the line breaks are cleared, and every line I want to keep a line break how to deal with it? (That is, to filter multiple
The example of this article describes the thinkphp bug resolution in the volist tag mod control of a certain record. Share to everyone for your reference. The specific methods are as follows:
Description of the BUG:
exists in the Thinkphp 2.0
File1=input ("Enter the filename you want to open:") + ". txt"
f1=open (File1, "R") for
line1 in F1.readlines ():
Line1=line1.strip ( "\ n")
print (line1)
Extensions: Compares the two files entered by the user and, if different, displays
Jquery:$ ("#accuracy"). Val ($ ("#accuracy"). Val (). replace (/\ +/g, ""));//Remove space
. replace (/\ +/g, "")//Remove Space method$ ("#content"). Val ($ ("#content"). Val (). replace (/[]/g, "")); Remove Space
. replace (/[]/g, "")//Remove
Here are a few ways to help you solve this problem.
The PHP version converts the in HTML into a line break in a text box:
Copy Code code as follows:
function Br2nl ($text) {
Return Preg_replace ('//i ', ', $text);
}
Sed
SED is a powerful text-processing tool
You can use a regular match to insert the text to delete changes, and so on
When SED is processed, one line is processed at a time, each time the current processing is stored in a temporary buffer, the
There are lines in the input, saved to the database, directly to see the feeling did not wrap, but the query results "in text Format display results" You will find that there is actually a line of change.
The next question came, page read show, why
Two problems: The 1.mysql does not support line-wrapping, textarea in the return of the incoming and then came out to become a space.The 2.JTable render default is inherited JLabel, and does not support line-wrapping display. In order to achieve a
Regular Expressions (UltraEdit Syntax):% Match Beginning-Indicates that the string to be searched must be at the beginning of the line.$ Match Line End-indicates that the string to be searched must be at the end of the row? Matches any single
Line breaks are different in Linux and Windows. 1. Line breaks: the line breaks in www.2cto. com1.windows are \ r \ n, and 2. the line breaks in linux/unix are \ n. Here: Carriage return: \ r0x0d (13) return; # enter (carriagereturn) line break: \ n0
Ultraedit implements "deleting all rows containing a keyword"
1. Press Ctrl + R to bring up the "replace dialog box"2. Check "Regular Expression" and "replace all from the top of the file" in the lower left corner (the regular expression
Modifier is an important reference for regular expressions in php. Next I will explain the Regular Expression Pattern modifier in PHP, for more information, see references.
The PHP pattern modifier, also known as the pattern modifier, is used
The PHP pattern modifier, also known as the pattern modifier, is used outside the delimiters of regular expressions. It is mainly used to adjust the interpretation of regular expressions, and extends some functions of regular expressions in
POSIX shell tips
This article is used to record some of the useful tips I have found. This is a paper about POSIX (and other noncompliant shell script techniques. I have always insisted that the Bourne system is not a good programming language,
The documentation written in Notepad under Linux doc Windows differs from those written by Vim or gedit under Linux! For example, the SH script written under Windows can be executed under Linux and may go wrong. Workaround: The reason is: Windows
CSS newlines: word-wrap & amp; word-break & amp; white-space & amp; word-spacing
Word-wrap:
First of all, the CSS attribute word-wrap has been renamed as overflow-wrap in CSS3, so the semantics is also made to avoid confusion with word-break;
1. How do I make a line break for my data?(1)1 PackageCom.himi.fileoutputstream;2 3 Importjava.io.FileNotFoundException;4 ImportJava.io.FileOutputStream;5 Importjava.io.IOException;6 7 8 /**9 * Ten * How to implement the data line wrapping? One *
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.