Re: How can I tell if a path is absolute?

From: Date: Sat, 17 Jul 2004 11:13:24 +0000
Subject: Re: How can I tell if a path is absolute?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-190836@lists.php.net to get a copy of this message
Anyway it's looking a lot like I'll have to detect the Win32 build of PHP at runtime, and choose the method based on that. All because PHP doesn't have an is_absolute function or anything similarly convenient. :-/ TX
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

« previous php.general (#190836) next »