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