note 49499 deleted from function.basename by tularis

From: Date: Sun, 30 Jan 2005 14:32:06 +0000
Subject: note 49499 deleted from function.basename by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-84215@lists.php.net to get a copy of this message
Note Submitter: KOmaSHOOTER at gmx dot de Reason: spam ---- if you want the name of the parent directory <?php $_parenDir_path = join(array_slice(split( "/" ,dirname($_SERVER['PHP_SELF'])),0,-1),"/").'/'; // returnes the full path to the parent dir $_parenDir = basename ($_parenDir_path,"/"); // returnes only the name of the parent dir // or $_parenDir2 = array_pop(array_slice(split( "/" ,dirname($_SERVER['PHP_SELF'])),0,-1)); // returnes also only the name of the parent dir echo('$_parenDir_path = '.$_parenDir_path.'<br>'); echo('$_parenDir = '.$_parenDir.'<br>'); echo('$_parenDir2 = '.$_parenDir2.'<br>'); ?>

« previous php.notes (#84215) next »