When do I use the PHP constant “PHP_EOL”?

前端 未结 19 2297
攒了一身酷
攒了一身酷 2020-11-22 06:21

When is it a good idea to use PHP_EOL?

I sometimes see this in code samples of PHP. Does this handle DOS/Mac/Unix endline issues?

19条回答
  •  [愿得一人]
    2020-11-22 07:12

    Handy with error_log() if you're outputting multiple lines.

    I've found a lot of debug statements look weird on my windows install since the developers have assumed unix endings when breaking up strings.

提交回复
热议问题