View Full Version : Getting directory name
Nightfire
06-30-2002, 08:51 PM
How can I get the name of the current directory a user is viewing?
Nightfire
06-30-2002, 09:19 PM
$url = explode("/",$PHP_SELF);
$filename = $url[sizeof($url)-1];
$dir = $url[sizeof($url)-2];
Doesn't matter, found this
firepages
07-01-2002, 02:01 AM
or ...
<?
echo dirname ($_SERVER[PHP_SELF]);
?>
:)
Nightfire
07-01-2002, 03:17 AM
Thanks :) Is your way less stress on the server too?
firepages
07-01-2002, 05:11 AM
without groping through the Zend source I am unsure how dirname() is handled internally but I would assume it would have to be more efficient ??
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.