<?
$DocName = "" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
$DirNow = dirname($DocName);
$drop = array("www.", "yourwebsite", ".com/", "-");
# here you drop the url, ex:
www.yourwebsite.com/
$pickup = array("", "", "", " ");
$folder = str_replace($drop, $pickup, $DirNow);
echo "Your Current Folder is:<br>";
echo "$folder";
?>