View Full Version : Getting directory name
06-30-2002, 08:51 PM
How can I get the name of the current directory a user is viewing?
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
07-01-2002, 02:01 AM
echo dirname ($_SERVER[PHP_SELF]);
07-01-2002, 03:17 AM
Thanks :) Is your way less stress on the server too?
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 ??
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.