Re: dirname(__FILE__)
| From: | Lorenzo Alberton | Date: | Thu, 17 Oct 2002 12:03:40 +0000 |
| Subject: | Re: dirname(__FILE__) | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-10104@lists.php.net to get a copy of this message | ||
Another option to includes could be this one:
$current_dir = getcwd(); // remember current directory
chdir('./'); // change to scripts directory
// all include()s relative to script's path go here...
chdir($current_dir); // change back to initial directoryBut I don't know if there's a performance gain or loss, and I still prefer the dirname(__FILE__) approach, since it's a one-line solution. I posted just in case there were someone wanting to do some benchmarks... Regards Lorenzo Alberton --- [Quipo ISP - Questa E-mail e' stata controllata dal programma Declude Virus] [Quipo ISP - This E-mail was scanned for viruses by Declude Virus]