code.fastix.org

Dateiansicht:

Datei:Projekte -> PHP:class Dir2Array -> _TEST_Dir2Array.php
md5:5feb1609a231fcd9a72ea9b1c6df94e2
sha1:8091caf0bb3380312467163a0fec551d6d763b05
Download-Link:Download
  1. <?php
  2. /**
  3. * This is only a test and a "show to use"
  4. **/
  5.  
  6. require_once('Dir2Array.class.php');
  7.  
  8. $o = new Dir2Array( '.' );
  9. $o -> setShowFoldersFirst( 1 );
  10. $o -> setShowHiddenFiles( 0 );
  11. $o -> setShowDirLinks( 0 );
  12. $o -> addIgnoreFilesRegex( '/^Arbeits/' );
  13. $o -> removeIgnoreFilesRegex( '/^Arbeits/' );
  14. $o -> setSortOrder( SORT_NATURAL | SORT_FLAG_CASE );
  15. $a = $o -> getArray();
  16.  
  17. $keys=array_keys( $a );
  18.  
  19. header ('Content-Type:text/plain; charset=UTF-8');
  20. foreach ( $keys as $file ) {
  21.     print "$file: ";
  22.     print_r( $a[$file] );
  23. }
  24.  
  25. $err=$o -> getErrors();
  26. if ($err) {
  27.     print "\n";
  28.     print_r( $err );
  29.     print "\n";
  30. } else {
  31.     print "\nKeine Fehler.\n" ;
  32. }