Re: climb up the path

From: Date: Wed, 18 Jun 2008 12:43:39 +0000
Subject: Re: climb up the path
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-275517@lists.php.net to get a copy of this message
Personally I use. <?php require_once(dirname(dirname(__FILE__)).'/config.php'); I think it's what most people do. /James Dempster On Wed, Jun 18, 2008 at 1:31 PM, Iv Ray <pobox@verysmall.org> wrote: > hi all, > > i need a way to get the path to the parent folder of the folder i am in. > one "dirty" way i found is this - > > require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . > ".." . DIRECTORY_SEPARATOR . > "config.php"); > > i can also explode() and reassemble all folders except the last, but this > looks also dirty... > > is there a direct way? > > iv > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#275517) next »