How can I get the script name? If my current script is index. php, how can I get the index? ------ Solution ------------------ basename (); check the manual ------ solution -------------------- $ str & quot; index. php & quot; $ strstrsub ($ str, 0. how can I get the script name?
Assume that my current script is index. php.
I want to get the index
How can this problem be solved?
------ Solution --------------------
Basename ();
Look at the manual
------ Solution --------------------
$ Str = "index. php ";
$ Str = strsub ($ str, 0,-4); // get the last and fourth digits from the first place, that is, get something before. php!
Echo $ str;
Or use a string to separate! But I think that's troublesome!
------ Solution --------------------
$ _ SERVER ['script _ filename']
------ Solution --------------------
Basename ($ _ SELF, '. php ')
------ Solution --------------------
Same as above