Forum Moderators: coopster

Message Too Old, No Replies

How to remove the extension on a url

Questions from an old topic

         

Henner

1:42 am on Jul 20, 2010 (gmt 0)

10+ Year Member



[webmasterworld.com...]

How did you remove the '.php' from the title?

penders

9:34 am on Jul 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



By 'title' I assume you are referring to the filename (or URL) of the current page? (As mentioned in that other thread)

In which case if the current page is "/path/to/file/home.php" (ie. the value of the PHP superglobal $_SERVER['PHP_SELF']) then you could do:

basename($_SERVER['PHP_SELF'],'.php');


to return "home" (without the .php extension)

: Welcome to WebmasterWorld

youfoundjake

3:08 am on Jul 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



We addressed it here a little bit..
[webmasterworld.com...]