I need to get the filename of the page that is loaded.
I used $PHP_SELF but it returns the folder and file, so, is there a way to either get just the filename, or get rid of everything from the / to the beginning?
If you can help tonight that would be greatly appreciated!
First argument, the pattern -- #.*[\\\/]([^\\\/]+)$# The # on either end is the pattern delimiter. Now, from left to right.
. -- matches anything * -- zero or more times [\\\/] -- match a back or forward slash ( -- start of sub-match [^\\\/] -- match anything other than a back or forward slash + -- one or more times ) -- end of sub-match
Second argument, the replacement -- '$1' $1 -- refers to what was matched in the patterns sub-match.