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
Use the PATH_SEPARATOR
constant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With