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
Explain about PHP cookies?
What is super keyword in c++?
How do you find the length of a string in php?
What are the advantages of oops in php?
What is the use of session and cookies in php?
Explain how can php and javascript interact?
How to randomly retrieve a value from an array?
How to include a file code in different files in php?
What is php7?
What is the correct php command to use to catch any error messages within the code?
Explain the difference between static and dynamic websites?
How does session work in php?
Is php 5 still supported?
What is $_session in php?
How can I embed a java program in php file and what changes have to be done in php.ini file?