Trejkaz Xaoza wrote:
Michael Ochs wrote:
Hi,
maybe you could try it with regular expressions! "[A-Z]:\\" or better
"[C-Z]:\\" because A and B is used just for floppy drives...
Take a look at www.php.net/preg_match/
I'm not sure if you noticed, but I said I wanted it to be portable.
Sure, "([A-Za-z]:)?[/\\]" would work to some extent, but would it work
perfectly? As far as I can tell, the path "C:/" is _relative_ on Linux and
BSD. Am I wrong?
TX
c:/ wouldn't even work as a path on unix systems. I don't know how paths
look on MacOS systems, so can't help you with that. However, after
removing the [a-z]: part of the path, you're stuck with an abosulute
path that is of the same type as in Unix. In Unix systems absolute paths
start with a forward-slash (eg. /usr/local or /home/me/, etc). After
removing the c: from eg. c:/this/and/that, you're left with
/this/and/that which looks pretty much the same :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php