开发者

How to get the filename of the download file from url using php/curl

开发者 https://www.devze.com 2023-03-20 00:12 出处:网络
I am having a url say : http://localhost/joomla/index.php?option=com_docman&task=doc_download&gid=1&Itemid=196

I am having a url say : http://localhost/joomla/index.php?option=com_docman&task=doc_download&gid=1&Itemid=196

How to get the original Download filename using php开发者_运维技巧 like DOC_1998.pdf or so.

Thanks in advance.


I believe you are looking for basename: http://www.php.net/manual/en/function.basename.php

$filename = array_shift(explode('?', basename($url)));
0

精彩评论

暂无评论...
验证码 换一张
取 消