Easiest way to fetch filename
Posted: Tue Mar 06, 2007 8:13 pm
Strangely I can't seem to find an easy way to determine the filename of the currently running script. I don't want the pathname, just the filename itself. Example, for a file in http://www.foo.com/bar/blah.php, I would want blah.php.
Basically, I have a series of php files which draw together multiple other files, one of which(the main body text) will be according to the current script filename. Example:
/pages/mypage.php
/pages/mypage.html
/inc/layout.html
What I want to do is use mypage.php to grab layout.html, do a str_replace of a <content/> tag using the contents of mypage.html
Thanks.
Basically, I have a series of php files which draw together multiple other files, one of which(the main body text) will be according to the current script filename. Example:
/pages/mypage.php
/pages/mypage.html
/inc/layout.html
What I want to do is use mypage.php to grab layout.html, do a str_replace of a <content/> tag using the contents of mypage.html
Thanks.