Hi, I dunno how to parse the file name and convert the first letter in php. Should get 'Filename' from filename.php. Anyone to throw some code samples? Thanks in advance.
There are several ways you can do this, some probably much more elegant than this. This should work even if the file isn't in the root of your site, it should also work with file extensions that are longer or different than .php. I haven't tested for any other possible snags like hyphenated filenames, etc. echo ucwords( substr($_SERVER["SCRIPT_NAME"], strrpos($_SERVER["SCRIPT_NAME"], "/") +1, strpos($_SERVER["SCRIPT_NAME"], ".") - strrpos($_SERVER["SCRIPT_NAME"], "/") - 1) ); PHP: