Why is PHP_EOL in PHP ineffective? The following program: & lt ;? Phpheader ('content-Type: text/html; charset = utf-8 '); function & nbsp; customError ($ errno, & nbsp; $ errstr why is PHP_EOL in PHP ineffective?
The following procedure:
Header ('content-Type: text/html; charset = utf-8 ');
Function customError ($ errno, $ errstr, $ errfile, $ errline ){
Echo'Error code:['. $ Errno.'] '. $ errstr. PHP_EOL;
Echo 'code line of the error: '. $ errline.' file '. $ errfile. PHP_EOL;
Echo 'php version: '. PHP_VERSION.' ('. PHP_ OS.') '. PHP_EOL;
Die ();
}
Set_error_handler ('customerror', E_ALL | E_STRICT );
$ A = array ('O' => 2, 4, 6, 8 );
Echo $ a [o];
Output:
Error code: [8] Use of undefined constant o-assumed 'O' the error code line: 12 file/usr/local/apache/htdocs/mytest/test2.php PHP version: 5.4.19 (Linux)
There is no line feed in the middle. why ??
My environment is shared by centos:
------ Solution --------------------
Echo $ a ['O'];
Line Feed is
------ Solution --------------------
PHP_EOL is text wrap, not html wrap