<?php
function getfiles1($path) {
foreach(scandir($path) as $afile) { if($afile=='.'||$afile=='..') continue;
getfiles1($path.'/'.$afile);
else
print_r($path.'/'.$afile.'<br />'); }
}
function getfiles2($path){
foreach(glob($path) as $afile) {//过滤掉了'.'和'..' getfiles2($afile.'/*');
else
}
}
PD9waHAKCmZ1bmN0aW9uIGdldGZpbGVzMSgkcGF0aCkgeyAKICAgIGZvcmVhY2goc2NhbmRpcigkcGF0aCkgYXMgJGFmaWxlKSB7CiAgICAgICAgaWYoJGFmaWxlPT0nLid8fCRhZmlsZT09Jy4uJykgY29udGludWU7IAogICAgICAgIGlmKGlzX2RpcigkcGF0aC4nLycuJGFmaWxlKSkKICAgICAgICAgICAgZ2V0ZmlsZXMxKCRwYXRoLicvJy4kYWZpbGUpOyAKICAgICAgICBlbHNlCiAgICAgICAgICAgIHByaW50X3IoJHBhdGguJy8nLiRhZmlsZS4nPGJyIC8+Jyk7IAogICAgfQp9CmZ1bmN0aW9uIGdldGZpbGVzMigkcGF0aCl7IAogICAgZm9yZWFjaChnbG9iKCRwYXRoKSBhcyAkYWZpbGUpIHsvL+i/h+a7pOaOieS6hicuJ+WSjCcuLicKICAgICAgICBpZihpc19kaXIoJGFmaWxlKSkKICAgICAgICAgIGdldGZpbGVzMigkYWZpbGUuJy8qJyk7CiAgICAgICAgZWxzZQogICAgICAgICAgcHJpbnRfcigkYWZpbGUuJzxiciAvPicpOwogICAgfQp9