PHP spaces, newline, _php tutorial

Source: Internet
Author: User
First of all, \n,\r,\t.

\ n Soft return:
Show line breaks in Windows and go back to the beginning of the next line
In Linux, Unix only represents line breaks, but does not go back to the beginning of the next line.
\ r Soft Space:
In Linux, Unix represents the return to the beginning of the line.
Represents a newline in Mac OS and returns to the beginning of the next line, equivalent to the effect of \ n in Windows.
\ t jump (move to next column)

A few notes:

They are valid in a double-quote or delimiter-represented string, and are not valid in a single-quote string.
\ r \ n generally used together, used to indicate the key on the keyboard return (Linux,unix), can also be used only \ n (windwos), in Mac OS with \ r to indicate enter!
\ t represents the "tab" key on the keyboard.

Line break symbols in the file:

Windows: \ n
Linux,unix: \ r \ n
Mac OS: \
Copy CodeThe code is as follows:
$dir = "E:/phpworkspace";
if ($handle = Opendir ($dir)) {
echo "directory path is: $dir/n";
echo "contained files:/n";
}
This is the correct way to traverse the directory
while (False!== ($file =readdir ($handle))) {
echo "$file/n";
}
?>

Copy CodeThe code is as follows:
$dir = "E:/phpworkspace";
if ($handle = Opendir ($dir)) {
echo "directory path is: $dir/n";
echo "contained files:/n";
}
This is the correct way to traverse the directory
while (False!== ($file =readdir ($handle))) {
echo "$file/n";
}
?>

http://www.bkjia.com/PHPjc/321101.html www.bkjia.com true http://www.bkjia.com/PHPjc/321101.html techarticle first of all, let's talk about \n,\r,\t. Soft return: In Windows, a newline is represented, and the beginning of the next line is the first position in Linux, Unix, but not back to the beginning of the next line. \...

  • Related Article

    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.