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 the difference between array_merge() and array_merge_recursive() in php?
Define anonymous classes in php7?
What is mysql_fetch_object?
What is smarty?
What does $globals mean?
Why session timeout is important?
How to return a value back to the function caller?
How can you associate a variable with a session?
Explain me what is the meaning of a persistent cookie?
Is rent a variable cost?
What are the benefits of using queries?
how to use http headers inside php? Write the statement through which it can be added?
Explain about switch statement in PHP?
What is the difference between for and foreach loop in php?
Is php object oriented?