Re: Comparison function for directories?



On Thu, 28 Feb 2008 18:57:11 +0100, laredotornado@xxxxxxxxxxx <laredotornado@xxxxxxxxxxx> wrote:

Hi,

I'm using php 4.4.4. Given two variables,

$dir1 = "/usr/local/apache2/htdocs/"
$dir2 = "/usr/local/apache2/htdocs"

What is a comparison function I could write that would say these two
directories are the same? A straight string comparison would not work
above.

$is_the_same_dir = realpath($dir1) == realpath($dir2);
--
Rik Wasmus
.