FUNCTION getCurrentDirectory() {
$path = DIRNAME($_SERVER['PHP_SELF']);
$position = STRRPOS($path,'/') + 1;
RETURN SUBSTR($path,$position);
}
$url = dirname(__FILE__);
$array = explode('/',$url); $count = count($array);
$currentFolderPathName = $array[$count-1];
$currentFolderName = basename(__DIR__);
$currentFolderFileName = basename(__FILE__);
$currentFolderPathName = getcwd();
?>
Anleitungen System: echo getCurrentDirectory(); ?>
$dir = opendir($currentFolderPathName);
while(false != ($file = readdir($dir)))
{
if(($file != ".") and ($file != "..") and ($file != "index.php") and ($file != "desktop.ini"))
{
$list[] = $file;
}
}
sort($list);
$i = 1;
foreach($list as $item) {
if ($i == 1) {
echo "- ".$item."
";
} else {
$fpath = $item;
$ext = pathinfo($fpath, PATHINFO_EXTENSION);
if (is_file($item)) {
echo "- ".$item."
";
} else {
echo "- ".$item."
";
}
}
$i++;
}
?>