This seems like a common questions but none of them seem to be what i'm looking for. If there is a website:
www.example.com/test.php
I want to pull the test.php and if it's something like:
test.php
www.example.com/folder/folder1/test.php
I want again to just pull test.php but everything seems to pull the exact path instead of just the page. Any suggestions?
$query = $_SERVER['PHP_SELF']; $path = pathinfo( $query ); $what_you_want = $path['basename'];
Voila.
2.1m questions
2.1m answers
60 comments
57.0k users