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
Do you know how can we check the value of a given variable is a number?
Is a number php?
Can you use php and javascript together?
Do you know what is the use of rand() in php?
What is the difference between Session and Cookie?
How to get length of an array in PHP?
Do you know design patterns. List few?
Why shouldn't I use mysql_* functions in php?
How can I increase my website session?
What is the purpose of pear in php?
Which is better get or post method?
What is session and why do we use it?
What is the use of is_array() and in_array()?
What is a php form?
What is a closure in php?