> How do I return the name of a file without any extensions or path info.
> Eg how do I return "about" from "http://www.domainz.com/about.htm".

Here's a quick and dirty way:

<?
$url = "http://www.domainz.com/about.htm";
$url = explode("/",$url);
$num = count($url);
$name = explode(".",$url[($num-1)]);
$documentname = $name[0];
echo "$documentname";
?>


> -----Original Message-----
> From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 6:52 PM
> To: PHP Mailing List
> Subject: [PHP] get name of file
> 
> 
> How do I return the name of a file without any extensions or path info.
> 
> Eg how do I return "about" from "http://www.domainz.com/about.htm".
> 
> Regards,
> 
> Matthew Delmarter
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to