dongmiyi8220 2016-08-25 06:31
浏览 46

从根文件夹中获取映像文件的名称。 文件夹的名称是上传

I am trying to get the name of a particular image file that has already been uploaded, not the one being uploaded in the folder to delete the file.

I have looked up all over google. Please help me. It is the last increment i have to make before the end of the day.

I do have the imageurl as http://localhost/public_html/upload/123.jpeg I have found this as my answer to delete the file but i do not know how to extract the file name

unlink($imagePath . $file_name);

Thank you

  • 写回答

3条回答 默认 最新

  • doujian1050 2016-08-25 06:36
    关注

    You can extract a file name from a path using basename like this:

     basename($imagePath); // output: 123.jpeg
    

    or without the extension:

    basename($imagePath, ".jpeg"); // output: 123
    
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题