开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜