note 55691 modified in function.dirname by tularis
| From: | tularis@php.net | Date: | Wed, 10 Aug 2005 18:18:14 +0000 |
| Subject: | note 55691 modified in function.dirname by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-93389@lists.php.net to get a copy of this message | ||
--- Edited by tularis@php.net ---
You could also have a look at the getcwd() function
--- End Edit ---
A nice "current directory" function.
function current_dir()
{
$path = dirname($_SERVER[PHP_SELF]);
$position = strrpos($path,'/') + 1;
print substr($path,$position);
}
current_dir();
I find this usefull for a lot of stuff! You can maintain a modular site with dir names as modules
names. At least I would like PHP guys to add this to the function list!
If there is anything out there like it, please tell me.
--was--
A nice "current directory" function.
function current_dir()
{
$path = dirname($_SERVER[PHP_SELF]);
$position = strrpos($path,'/') + 1;
print substr($path,$position);
}
current_dir();
I find this usefull for a lot of stuff! You can maintain a modular site with dir names as modules
names. At least I would like PHP guys to add this to the function list!
If there is anything out there like it, please tell me.
http://php.net/manual/en/function.dirname.php