读书人

PHP_EOL 用法 : Most Worthless Const

发布时间: 2013-04-07 12:50:11 作者: rapoo

PHP_EOL 用法 : Most Worthless Constant?

PHP_EOL may very well be the most worthless general-purpose constant in modern PHP. It's supposed to be helpful for cross-platform developing, for example you could write a PHP-powered shell script that says:

?

and then expect the proper newline to terminate the output string based on the platform PHP is running on.

That's all well and good, but the following is functionally equivalent:

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

?

?

来源: http://blog.sina.com.cn/s/blog_6dbaeb9b0100z4tt.html

?

?

读书人网 >操作系统

热点推荐