May 17, 2007
How to get the filename from an URL
$url = 'http://www.site.com/images/logo.gif';
$x = explode('/', $url);
$filename = trim($x[count($x)-1]);
echo $filename;
The code output will be “logo.gif”
May 17, 2007
$url = 'http://www.site.com/images/logo.gif';
$x = explode('/', $url);
$filename = trim($x[count($x)-1]);
echo $filename;
The code output will be “logo.gif”
Leave a Reply
You must be logged in to post a comment.