I have a little snippet that grab's the filename, including the extension.
$currURL = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
given a url... http://www.somewebsite.com/pretty/url/here/this-is-a-page.php
it returns this-is-a-page.php
. I would like to be able to return simply, this-is-a-page
.
I'm pretty obsessive about doing stuff like this in as little code as possible... how would you do this in a simple and elegant manner?