ASP-FastBoard - Demo/Support-Forum
Forum anmelden / register Board



SearchSearch CalendarCalendar GalleryGalleryAuction-PortalAuctions GlobalGlobal Top-ListTopMembersMembers StatisticsStats
get your RSS-Feed
Language/Sprache:  Admin  
 Login: ChatChat (0) new User-MapUser-Mapsend Passwordsend Password RegisterRegister

Forum Overview » Programmieren » PHP » Verzeichnis-Baum auflisten mit PHP
Pages: (1) [1] »
Registration necessaryRegistration necessary
Verzeichnis-Baum auflisten mit PHP
Cyberlordno Access no Access first Post cannot be deleted -> delete the whole Topic 
Group: Administrator
Level: heavy Spammer


Posts: 3607
Joined: 3/11/2004
IP-Address: saved
offline


Mit diesem PHP-Code könnt ihr Dateien und Verzeichnisse auflisten:


<?php
function is_dir_ex($dirname)
{
$handle=opendir($dirname);
if(readdir($handle)=='.')
$result=true;
else
$result=false;
closedir($handle);
return $result;
}
function list_dir($dirname)
{
if($dirname[strlen($dirname)-1]!='\')
$dirname.='\';
static $result_array=array();
$handle=opendir($dirname);
while ($file = readdir($handle))
{
if($file=='.'||$file=='..')
continue;
if(is_dir_ex($dirname.$file))
list_dir($dirname.$file.'\');
else
//array_push($result_array,$dirname.$file);
$result_array[]=$dirname.$file;
}
closedir($handle);
return $result_array;

}

$array=list_dir('c:\php4');
foreach($array as $value)
{
echo $value;
echo "<br>";
}
?>




Forum-Changelog || zu unseren Angeboten
6/8/2004 11:50:30 PM    
Registration necessaryRegistration necessary
Pages: (1) [1] »
all Times are GMT +1:00
Thread-Info
AccessModerators
Reading: all
Writing: User
Group: general
none
Forum Overview » Programmieren » PHP » Verzeichnis-Baum auflisten mit PHP

.: Script-Time: 0.063 || SQL-Queries: 6 || Active-Users: 1,095 :.
Powered by ASP-FastBoard HE v0.8, hosted by cyberlord.at