PDA

View Full Version : Code to display current file name


_Spud_
08-23-2002, 01:30 PM
Hello all.

At the moment I am in the process of redesigning my website. I need some code that will display the name of the current document on the users screen.

So, if one of the pages were called user.php the scripts would pick up the name user , and capitalise the U and drop the extension.

Can someone help me with this please?

Many thanks

firepages
08-23-2002, 03:21 PM
<?

echo ucfirst(substr(basename($_SERVER['SCRIPT_NAME']),0,-4));

?>


!! always wondered if I would ever get to use ucfirst() !!

_Spud_
08-23-2002, 03:53 PM
It works

Thank's for the help