dsimib1625 2016-07-31 17:11
浏览 102

获取路径已存储到数据库中的文件的目录

I have a path of file that I stored into a table database like this :

D:/XAMPP/htdocs/develop_tsurumaru/assets/iwwi_file/DO_FOLDER/Damage_Report/0080//thumbs/thumb_52.jpg

You know, this path is a string type now. How to get its directory, which is :

D:/XAMPP/htdocs/develop_tsurumaru/assets/iwwi_file/DO_FOLDER/Damage_Report/0080//thumbs/

Thanks

  • 写回答

1条回答 默认 最新

  • dragonfly9527 2016-07-31 17:19
    关注

    If you want to get a list of all the files and folders under thumbs folder, then follow the below code.

    <?php
      $dir    = 'D:/XAMPP/htdocs/develop_tsurumaru/assets/iwwi_file/DO_FOLDER/Damage_Report/0080//thumbs';
      $files = scandir($dir);
    
      print_r($files); // This will print an array with all the files and folders
    ?>
    
    评论

报告相同问题?