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
Where can I find php ini file?
What is printf in php?
Tell me how to create a text file in php?
What is abstraction php?
Explain Booleans in PHP?
What are objects in php?
Where is the submitted form data stored?
Are php variables global?
Does cors prevent csrf?
Is salary a ratio or interval?
How many keywords are there in php?
Who is the father of php and what is the current version of php and mysql?
Which functions are used to count the total number of array elements in php?
What is filter_var?
Tell me how can I display text with a php script?