2012-04-29 160 views

回答

2

我想你应该看看PHP globhttp://php.net/manual/en/function.glob.php

示例:搜索dir/module和子目录live.php或任何与live.php

glob_recursive('dir/module/*live.php'); 

函数结束使用:http://www.php.net/manual/en/function.glob.php#106595

if (! function_exists('glob_recursive')) 
{ 
    function glob_recursive($pattern, $flags = 0) 
    { 
     $files = glob($pattern, $flags); 
     foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) 
     { 
      $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags)); 
     } 
     return $files; 
    } 
} 
+0

a绝对是根据需要....谢谢你爸爸 – shuja 2012-04-29 17:59:14

相关问题