Location: PHPKode > scripts > php directory explorer > php-directory-explorer/example.php
<?php
include "php_dirs_explorer.class.php";


$expl = new php_dirs_explorer;

//Now it's needed set FULL path of directory which should be seen 
//root_dir - name of variable and it should be static!
// /home/shared_dir - full path of shared directory for *nix
// c:/shared_dir - full path of shared direcotory for win
$expl->Set("root_dir","/home/shared_dir");

//Now it's needed set path of icons
//icons_dir - name of variable and it should be static!
//icons/ - directory of icons
$expl->Set("icons_dir","icons/");


//Now it's needed to set files of icons for various file types
$types['image.gif'] = array ('jpg', 'gif','png');
$types['txt.gif'] = array ('txt');
$types['winamp.gif'] = array ('mp3');
$types['mov.gif'] = array ('mov');
$types['wmv.gif'] = array ('avi', 'mpeg','mpg');
$types['rar.gif'] = array ('rar');
$types['zip.gif'] = array ('zip');
$types['word.gif'] = array ('doc');
$types['pdf.gif'] = array ('pdf');
$types['excel.gif'] = array ('xls');
$types['html.gif'] = array ('htm','html');
$types['exe.gif'] = array ('exe');
$types['mdb.gif'] = array ('mdb');
$types['ppt.gif'] = array ('ppt');
//types - name of variable and it should be static!
//$types - array of icons files and file types
$expl->Set("types",$types);


//Now it's needed set file of icon for undefined file types
//un_icon - name of variable and it should be static!
//file.gif file of icon for undefined file types
$expl->Set("un_icon","file.gif");

//Now it's needed to set file of icon for directory
//dir_icon - name of variable and it should be static!
//directory.gif file of icon for directories
$expl->Set("dir_icon","directory.gif");


$expl->show_dirs();
?>
Return current item: php directory explorer