jquery - TreeView directory structure in php -
- how display files , folders available in current directory php (ftp)
- see attached image example....
define('site_url',"http://yourdomain.com"); function listfolderfiles($dir){ $filefolderlist = scandir($dir); echo '<ul>'; foreach($filefolderlist $filefolder){ if($filefolder != '.' && $filefolder != '..'){ if(!is_dir($dir.'/'.$filefolder)){ echo '<li><a target="_blank" href="'.site_url.'/'.ltrim($dir.'/'.$filefolder,'./').'">'.$filefolder.'</a>'; } else { echo '<li>'.$filefolder; } if(is_dir($dir.'/'.$filefolder)) listfolderfiles($dir.'/'.$filefolder); echo '</li>'; } } echo '</ul>'; } listfolderfiles('uploads/'); // function call directory path (e.g. : upload/)
Comments
Post a Comment