- Original Message -
From: Matthew Delmarter <[EMAIL PROTECTED]>
To: PHP Mailing List <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 6:51 PM
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
> 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:
http://www.domainz.com/about.htm";
$url = explode("/",$url);
$num = count($url);
$name = explode(".",$url[($num-1)]);
$doc
$PHP_SELF
returns the file name..
go to php website manual and serach for it..
john
Matthew Delmarter wrote:
> 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
>
> -
matthew,
that'd be a complex regexp...there are lots of books and tutorials on
them...definitely worth learning...
search google for regular expression tutorial...you'll find tons of hits,
like this:
http://gosling.miass.chel.su/books/Perl/3/RegExp_Tutorial.html
-jack
-Original Message-
4 matches
Mail list logo