PHP_EOL

PHP中除去换行符php

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

换行符windows

unix系列用 \n函数

windows系列用 \r\nspa

mac用 \r.net

PHP中能够用PHP_EOL来替代,以提升代码的源代码级可移植性unix

能够用函数get_defined_constants()来获取全部PHP常量code

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

相关文章
相关标签/搜索