Page 1 of 1

How to display page name without extension

Posted: Wed Jan 04, 2006 9:58 pm
by spamyboy
Twigletmac | Please use meaningful titles for your threads (I have adjusted this one to aid other people searching for information)

How to display in page title file name (for e.g. if http://www.gooogle.com then topic would be index.php) but without ".php"?

Posted: Wed Jan 04, 2006 10:10 pm
by timvw
Assuming you have a string $title that contains "index.php". All you have to do is make a string without the last 4 characters: http://www.php.net/substr is a good place to start...

Posted: Wed Jan 04, 2006 10:20 pm
by spamyboy
Thanks :)

Posted: Thu Jan 05, 2006 8:43 am
by twigletmac
You can also use basename()

Mac