How do I properly split a PATH variable in PHP?

前端 未结 4 760
囚心锁ツ
囚心锁ツ 2021-01-11 15:43

I want to split

$path = getenv(\'PATH\');

into its components. How do I determine the separator char in an os-dependent fashion?

4条回答
  •  失恋的感觉
    2021-01-11 16:17

    I seem to remember that Windows will accept both forward- and back-slashes as a file-separator, so you may not have to worry about it.

提交回复
热议问题