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)));
精彩评论