Does PHP have a function to detect the OS it's running on?

后端 未结 13 2484
北荒
北荒 2021-02-14 17:00

I wouldn\'t know under what keyword to look for this in the PHP database, so I\'m asking here.

Reason I want to know is because of how different Operating Systems handle

13条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 17:19

    *"BTW, nix OS use \n as new line. Mac usees \r, Windows - \r\n"

    ARRRGH! PLEASE STOP PERPETUATING THIS MYTH!

    Mac OS 9 used that like 10 years ago, but no one uses OS9 anymore. MACS USE UNIX LINE ENDINGS. \n. "Mac" used today should refer to contemporary computers, just as "Windows" refers to XP or vista unless otherwise qualified.

    Saying Macs use \r is about as correct as saying that "Windows runs on top of MS-DOS, supports only the FAT16 filesystem, and has no 64-bit support."

    Nobody should ever ever use \r for anything under any circumstances. Unless they are targeting old-ass macs.

提交回复
热议问题