CodeIgniter directory helper

CodeIgniter files and folders tree list

$dir_map = directory_map('../folder_name/'); // returns array with content of the folder
dump($dir_map); // returns array('1'=>'index.php','2'=>'style.css')
$dir_map = directory_map('../folder_name/', 2); // return content of the folder with 2 levels deep
$dir_map = directory_map('../folder_name/', FALSE, TRUE); // return content of the folder with hidden files

Leave a Reply

Your email address will not be published. Required fields are marked *