Anonymous
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>'; } $return .= '<li class="file">' . $file->getFilename() . '</li>'; } $return .= '</ul>'; return $return;}echo get_list('/home/matt/sources/');