"Go" PHP except for the use of newline characters and Php_eol variables

Source: Internet
Author: User
"Go" PHP removes the use of line breaks and Php_eol variables

About \n,\r,\t?

\ n Soft return:? In Windows, it represents a newline and goes back to the beginning of the next line, only in Linux, UNIX, but not back to the beginning of the next line.

\ r Soft space:? In Linux, Unix represents the return to the beginning of the line.? in Mac OS, it is the first place to return to the next line, equivalent to the effect of \ n in Windows.

\ t jump (move to next column)?

A few notes:?

    1. They are valid in a double-quote or delimiter-represented string, and are not valid in a single-quote string.
    2. \ r \ n generally used together, to indicate the key on the keyboard return (Linux,unix), you can also only use \ n (windwos), in Mac OS with \ r to indicate carriage returns.
    3. \ t represents the "tab" key on the keyboard.
    4. NewLine symbol in file: Windows: \n,linux,unix: \ r \ n

?

????? Php_eol (end of line) is a well-defined variable, representing the PHP newline character, which will change depending on the platform, under Windows will be/r/n, under Linux is/N, under Mac is/R. Just press the following to change the line.

?

$str = Str_replace (Php_eol, ", $STR);

?

?

This article transferred from: http://www.nowamagic.net/librarys/veda/detail/1276

?

  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.