Hallo ich habe folgende funktion, ich habe probleme die while schleife in das return zu legen.
das ergebniss ist immer nur ein eintrag.
wenn ichg diese zeile
so ändere und das return weglasse habe ich ein grösseres ergebnis
PHP-Code:
function directory_tree($address,$comparedate){
@$dir = opendir($address);
if(!$dir){ return 0; }
while($entry = readdir($dir)){
if(is_dir("$address/$entry") && ($entry != ".." && $entry != ".")){
directory_tree("$address/$entry",$comparedate);
}
else {
if($entry != ".." && $entry != ".") {
$fulldir=$address.'/'.$entry;
$last_modified = filemtime($fulldir);
$last_modified_str= date("Y-m-d H:i:s", $last_modified);
if($comparedate < $last_modified) {
$messages .= $fulldir.'=>'.$last_modified_str."<BR>";
}
}
}//while
}
return $messages;
}
wenn ichg diese zeile
PHP-Code:
$messages .= $fulldir.'=>'.$last_modified_str."<BR>";
PHP-Code:
echo $fulldir.'=>'.$last_modified_str."<BR>";
Kommentar