On the problem of php newline characters

I print newline characters under mac

var_dump(PHP_EOL);

Google displays the source code as follows:
clipboard.png

html:

clipboard.png

then the print result shows that PHP_EOL on mac is equivalent to\ n

.

and Baidu"s results are as follows:
\ n: UNIX system line Terminator
\ n\ r: window system Line Terminator
\ r: MAC OS system Line Terminator

so, does anyone know why? A very strange question

Apr.13,2022

try to go to Wikipedia when you have questions, don't go to Baidu, post it, you know, library.

the MAC OS here is the very old operating system used in the old Apple desktop system, which has been disabled since 2002.

All operating systems after

are Unix core, so drink Unix just like that.


different operating system newline characters are different, so PHP_EOL is defined as automatic adaptation, which represents different values under different operating systems, which can improve the portability of the source code. A similar usage is DIRECTORY_SEPARATOR .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd9ab4-3091e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd9ab4-3091e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?