All pastes #741739 Raw Edit

Stuff

public php v1 · immutable
·published 2007-10-18 22:55 UTC
rendered paste body
<?phpfunction traverse($dir,$level,&$static,&$dynamic){  $dHandle = opendir($dir);  while (false !== ($file = readdir($dHandle))) {      //echo "$dir/$file\n";          if(is_dir($dir.'/'.$file) && substr($file,0,1)!='.'){      traverse($dir.'/'.$file,$level+1,&$static,&$dynamic);    } else {      if(substr($file,-4) == '.php' || substr($file,-4) == '.htm' || substr($file,-4) == '.ssi' || substr($file,-4) == 'html'){        $f = file_get_contents("$dir/$file");        if(false === strstr($f,'ssi/')){          $static[] = "$dir/$file";        } else {          $dynamic[] = "$dir/$file";        }      }    }  }  closedir($dHandle);}$static = array();$dynamic = array();traverse('.',1,$static,$dynamic);echo "Static\n";foreach($static as $v){  echo $v,"\n";}echo "Dynamic\n";foreach($dynamic as $v){  echo $v,"\n";}?>