Afficher un message
Vieux 29/02/2008, 16h35   #3
Álvaro G. Vicario
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Comparison function for directories?

*** Rik Wasmus escribió/wrote (Thu, 28 Feb 2008 19:00:09 +0100):
>> $dir1 = "/usr/local/apache2/htdocs/"
>> $dir2 = "/usr/local/apache2/htdocs"
>>

> $is_the_same_dir = realpath($dir1) == realpath($dir2);


Just two remarks:

- In Unix, the file system is case sensible. So (depending on what you need
this for) you may use === instead.

- realpath() returns FALSE when the path does not exist; take it into
account.


--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor austrohúngaro: http://www.demogracia.com
--
  Réponse avec citation
 
Page generated in 0,04630 seconds with 9 queries