Home  >  Article  >  Backend Development  >  Detailed analysis of PHP_EOL newline character in php_PHP tutorial

Detailed analysis of PHP_EOL newline character in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:25:45735browse

Used in unix series n
Used in windows series rn
Used in mac r
PHP_EOL can be used instead in PHP to improve the source code level portability of the code

For example:

Copy code The code is as follows:

echo PHP_EOL;
/ /windows platform is equivalent to echo "rn";
//unixlinux platform is equivalent to echo "n";
//mac platform is equivalent to echo "r";

We can use Function get_defined_constants() to get all PHP constants.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/824938.htmlTechArticleUse n in the unix series, rn in the windows series, r in mac, you can use PHP_EOL instead in PHP to improve Source code level portability of code, for example: Copy the code as follows: echo PHP...
Statement:
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