public static function get_files($dir, $including_dirs = false, $hidden = false, $extension = null)
	{
    $dir = self::clean($dir);
    clearstatcache();
    if ( $dir === './' ){
      $dir = '.';
    }
    if ( is_dir($dir) && (($dir === '.') || ((strpos(basename($dir), '.') !== 0) || $hidden)) ){
			$files = [];
			$fs = scandir($dir, SCANDIR_SORT_ASCENDING );
      //$encodings = ['UTF-8', 'WINDOWS-1252', 'ISO-8859-1', 'ISO-8859-15'];
			foreach ( $fs as $f ){
				if ( $f !== '.' && $f !== '..' ){
          /*
          $enc = mb_detect_encoding($f, $encodings);
          if ( $enc !== 'UTF-8' ){
            $f = html_entity_decode(htmlentities($f, ENT_QUOTES, $enc), ENT_QUOTES , 'UTF-8');
          }
          */
          if ( $hidden || (strpos(basename($f), '.') !== 0) ){
            if ( $including_dirs ){
              $files[] = self::cur($dir.'/').$f;
            }
            else if ( is_file($dir.'/'.$f) ){
              if ( !$extension || (strtolower($extension) === strtolower(bbn\str::file_ext($f))) ){
                $files[] = self::cur($dir.'/').$f;
              }
            }
          }
				}
			}
      if ( \count($files) > 0 ){
        bbn\x::sort($files);
      }
			return $files;
		}
		return false;
	}