PHP_EOL
换行符
unix系列用 \n
windows系列用 \r\n
mac用 \r
PHP中可以用PHP_EOL来替代,以提高代码的源代码级可移植性
如: 
<?php
    echo PHP_EOL;
    //windows平台相当于    echo "\r\n";
    //unix\linux平台相当于    echo "\n";
    //mac平台相当于    echo "\r";

类似常用的还有
DIRECTORY_SEPARATOR
可以用函数get_defined_constants()来获取所有PHP常量
<?php
    print_r(get_defined_constants());//get_defined_constants()返回所有常量数组

 

相关文章:

  • 2021-11-20
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
猜你喜欢
  • 2021-12-10
  • 2022-03-02
  • 2022-12-23
  • 2021-08-05
  • 2021-07-28
  • 2022-12-23
相关资源
相似解决方案