Tag Archives | PHP

List only folder in a given path by php

getDirectory(’../templates’); function getDirectory( $path = ‘.’, $level = 0 ) { // Directories to ignore when listing output. $ignore = array( ‘.’, ‘..’ ); // Open the directory to the handle $dh $dh = @opendir( $path ); // Loop through the directory while( false !== ( $file = readdir( $dh ) ) ) { // […]

Read full story Comments { 0 }