Symbols available for various php Operating Systems

Source: Internet
Author: User
Welcome to the Linux community forum and interact with 2 million technicians to enter different operating systems with different symbols. How can we write PHP code so that we can port it in different operating systems? 1. DIRETORY_SEPORATOR default file path separator for the current operating system $ unixpathvartesta. php: Required for unix systems

Welcome to the Linux community forum and interact with 2 million technical staff> entering different operating systems has different symbols. How can we write PHP code so that we can port it in different operating systems? 1. DIRETORY_SEPORATOR the default file path separator $ unixpath = "/var/test/a. php": // required for unix systems"

Welcome to the Linux community forum and interact with 2 million technicians>

Different operating systems have different symbols. How can we write PHP code so that we can port different operating systems?

1. DIRETORY_SEPORATOR default file path Separator of the current operating system

$ Unixpath = "/var/test/a. php": // you must use "/" as the file path Separator in unix.

$ Windwospath1 = "C: \ www \ test \ aa. php ": // in windows," \ "is used as the file path Separator by default, but" \ "must be escaped.

$ Windowspath2 = "www/test/a. php" // This type is recommended.

For program portability, we recommend that you use "/" for file paths, or you can use DIRETORY_SEPORATOR.

2. linefeed of the current PHP_EOL System

\ R \ n in windows indicates a line break

In unix, \ r indicates a line break.

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.