首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

PHP_EOL 用法 : Most Worthless Constant

2013-04-07 
PHP_EOL 用法 : Most Worthless Constant?PHP_EOL may very well be the most worthless general-purpose

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

?

?

热点排行