codice:
$path_parts = pathinfo($_SERVER['PHP_SELF']);

echo $path_parts['dirname'];