I need to detect page to do some styling on a website, right now I’m using
$currentpage = $_SERVER['REQUEST_URI'];
but this returns something like /development/en/contact.php
I would like something that will only return contact.php
is there a method to achieve this?
It will return only the file and strips the folders. For more information see
basename()Note the usage of
SCRIPT_NAMEinstead ofREQUEST_URIasREQUEST_URImay contain additional “crap”: