I want to split
$path = getenv(\'PATH\');
into its components. How do I determine the separator char in an os-dependent fashion?
You can use the PATH_SEPARATOR constant, then the DIRECTORY_SEPARATOR constant to split the path if needed. See Directory Predefined Constants
PATH_SEPARATOR
DIRECTORY_SEPARATOR