http://community.csdn.net/Expert/topic/3451/3451358.xml?temp=.620495其中的:loopDir($root,$filter=null)方法便是做此用途

解决方案 »

  1.   

    <?php
    function test($path) { while (false !== ($entry = $d->read())) { if("." != $entry && ".." != $entry) {
    if(is_dir($path.$entry) && !is_link($path.$entry)) { test($path.$entry); }else{ echo "文件:".$path.$entry."<br>\n";//这里你自己改改 }
    } } $d->close();
    }
    test("/dirA/");
    ?>
      

  2.   

    <?php
    function test($path) { while (false !== ($entry = $d->read())) { if("." != $entry && ".." != $entry) {
    if(is_dir($path.$entry) && !is_link($path.$entry)) {
    echo("目录:".$path.$entry."<br>\n");
    test($path.$entry); }else{ echo "文件:".$path.$entry."<br>\n";//这里你自己改改 }
    } } $d->close();
    }
    test("/dirA/");
    ?>
      

  3.   

    建议看看php的帮助文档中的目录函数库