I want to echo only current page name with extenstion......... for example............... url is "example.com/test.php" I want to echo only "test.php" how can do it?????????? plz help me...............
you'll find the following page useful http://www.webcheatsheet.com/PHP/get_current_page_url.php found after a quick google. hope this helps
http://php.net/manual/en/function.parse-url.php You should be able to use the path to get it. $url = 'http://example.com/test.php'; $parsed_url = parse_url($url); print_r($parsed_url); PHP:
Some PHP variables off the top of my head that might do this are: $_SERVER['SCRIPT_FILENAME']; __FILE__; $_SERVER['REQUEST_URI']; PHP: