hmvrulz Posted September 27, 2008 Share Posted September 27, 2008 $filename = basename(__FILE__, ".php"); am using tht in file2.php but file1.php includes file2.php so how can i get the file name of file1.php using basename() but being included in file2.php file1.php - main files executed files2.php - has this variable Link to comment https://forums.phpfreaks.com/topic/126055-getting-the-filename-of-a-file/ Share on other sites More sharing options...
papaface Posted September 27, 2008 Share Posted September 27, 2008 $filename = basename($_SERVER['SCRIPT_NAME'], ".php"); Link to comment https://forums.phpfreaks.com/topic/126055-getting-the-filename-of-a-file/#findComment-651863 Share on other sites More sharing options...
hmvrulz Posted September 27, 2008 Author Share Posted September 27, 2008 $filename = basename($_SERVER['SCRIPT_NAME'], ".php"); tahnx mate... any idea how to include the full path of the server into it... should i concantinate it with the prev server path Link to comment https://forums.phpfreaks.com/topic/126055-getting-the-filename-of-a-file/#findComment-651899 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.