* Thus wrote Trejkaz Xaoza: > Jason Barnett wrote: > > Ahhhh, methinks I have a competitor for a FileSystem Manager :) Perhaps I > > misunderstand your problem, but this works fine for me (WinXP) because > > realpath > > [quote]Returns canonicalized absolute pathname[/quote]: > > > > <?php > > > > // we know __FILE__ is an absolute path > > $file = __FILE__; > > echo realpath(__FILE__) == $file ? 'The same path' : 'Not the same path'; > > > > ?> > > > > http://www.php.net/realpath > > That works because the value in __FILE__ seems to be both canonicalised and > absolute. > > For an example which breaks, realpath('/home') on my server returns > '/usr/home', so your example would claim that /home is not absolute. Yet, > it is. :-/
A simple workaround is testing OS: if (windows) // use realpath method } else { $absolute = $path{0} == '/'; } Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php