...

View Full Version : Getting directory name



Nightfire
06-30-2002, 09:51 PM
How can I get the name of the current directory a user is viewing?

Nightfire
06-30-2002, 10: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, 03:01 AM
or ...



<?
echo dirname ($_SERVER[PHP_SELF]);
?>



:)

Nightfire
07-01-2002, 04:17 AM
Thanks :) Is your way less stress on the server too?

firepages
07-01-2002, 06: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 ??



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum