Directory Listing from a Path
$path = dirname(__FILE__); $listing = array_filter(scandir($path), function($var) { // remove special directories ‘.’ and ‘..’ from listing if( preg_match(‘/^[\.]{1,2}$/’, $var) ) { return FALSE; } // remove files from listing if( !is_dir($var) ) { return FALSE; } return TRUE; }); This is a little snippet of code I’ve been using a lot recently. This function [...]