note 62934 deleted from function.explode by mazzanet
| From: | mazzanet@php.net | Date: | Sun, 09 Apr 2006 07:53:13 +0000 |
| Subject: | note 62934 deleted from function.explode by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107589@lists.php.net to get a copy of this message | ||
Note Submitter: emailfire at gmail dot com
----
To get the filename from a URL:
<?php
$url = 'http://www.site.com/images/logo.gif';
$x = explode('/', $url);
$filename = trim($x[count($x)-1]);
echo $filename; //Will output "logo.gif"
?>