Re: climb up the path

From: Date: Wed, 18 Jun 2008 15:22:31 +0000
Subject: Re: climb up the path
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-275524@lists.php.net to get a copy of this message
Stut wrote:
On 18 Jun 2008, at 13:57, Iv Ray wrote:
James Dempster wrote:
Personally I use. <?php require_once(dirname(dirname(__FILE__)).'/config.php'); I think it's what most people do.
A... very interesting, thanks. To get the path only I did this -
$path         = dirname(__FILE__);
$parts        = explode(DIRECTORY_SEPARATOR, $path);
array_pop($parts); $INSTALL_PATH = implode(DIRECTORY_SEPARATOR, $parts); It's kind of long... If somebody has a better idea, I would be glad to hear.
$path = dirname(dirname(__FILE__)); That will get you the parent directory. -Stut
Iv, tell me why you are wanting to do this? If it is the reason I think it is, I can give you a better way to accomplish this. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare

« previous php.general (#275524) next »