Answer Posted / nilsoft
Method 1.
$file = trim($_SERVER["SCRIPT_NAME"],'/');
Method 2.
$file =
substr($_SERVER["SCRIPT_NAME"],1,strlen($_SERVER["SCRIPT_NAME"])-1);
Method 3.
$file = str_replace('/','',$_SERVER["SCRIPT_NAME"]);
Method 4.
$file = basename($_SERVER["SCRIPT_NAME"]);
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is php and its advantages?
How to retrieve the original query string?
What is the best way to avoid email sent through php getting into the spam folder?
What is the default time in seconds for which session data is considered valid?
What is an anti csrf token?
Where do I run php code?
What is difference between strstr() and stristr()?
What does php do?
What is whitespace in php?
Tell me what is the use of the function htmlentities?
What is $_ post in php?
What is htaccess in php?
How to create an array of a group of items inside an html form?
Is age interval or ordinal?
What is difference between echo and print_r in php?