Something
public php v1 · immutable<?phpfunction get_list($path){ $return = '<ul>'; foreach (new DirectoryIterator($path) as $file) { if( $file->isDot() ) { continue; } if( $file->isDir() ) { $return .= '<li class="directory">' . $file->getFilename() . get_list( $file->getPathname()) . '</li>'; } else { $return .= '<li class="file">' . $file->getFilename() . '</li>'; } } $return .= '</ul>'; return $return;}