PHP_EOL

PHP中除去换行符

$str = str_replace(array("
", "
", "
"), "", $str);
$str = str_replace(PHP_EOL, '', $str); 

换行符

unix系列用

windows系列用

mac用

PHP中可以用PHP_EOL来替代,以提高代码的源代码级可移植性

可以用函数get_defined_constants()来获取所有PHP常量

php常量:http://php.net/manual/zh/reserved.constants.php

如果我能一直坚持下去,就像坚持当初的梦想一样,或许我也能成为大神呢,哈哈哈。
原文地址:https://www.cnblogs.com/faraway-tiny/p/5405624.html