note 55691 added to function.dirname
| From: | renich at woralelandia dot com | Date: | Wed, 10 Aug 2005 17:15:09 +0000 |
| Subject: | note 55691 added to function.dirname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93387@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/function.dirname.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55691
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55691&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55691&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55691&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55691&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55691&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55691&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55691&report=yes
Search -- http://master.php.net/manage/user-notes.php