Determine OS
Posted: Sat Apr 15, 2006 8:51 pm
Currently I'm using the PHP_OS constant
I need to determine if I'm on Windows or a *nix because I have a script which splits() paths on directory delimiters...
Should I use this OS specific approach or can I use regex to split on either?
On Windows can you not use both / or \ slash to delimit directories?
The code above only works on my production server *nix, but when I tried it on my desktop obviously it crapped all over me
What is a good, cross platform way of spliting a path into individual directory units?
Cheers
I need to determine if I'm on Windows or a *nix because I have a script which splits() paths on directory delimiters...
Code: Select all
$arr1 = split('/', strtolower($path1));On Windows can you not use both / or \ slash to delimit directories?
The code above only works on my production server *nix, but when I tried it on my desktop obviously it crapped all over me
What is a good, cross platform way of spliting a path into individual directory units?
Cheers