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 what is the use of "echo" in php?
How do I check environment variables?
What is $globals php?
Write a program to display reverse of any number?
How is php different from other languages?
Tell me what is the difference between characters 34 and x34?
What is the difference between runtime exception and compile time exception?
What is global array in php?
Hi this is amul jani here, i complied my graduation in B.com stream.. but as career i looking for PHP language.. to get shape my career. so is that possible to enter in IT world.. for me how much scope of develop my career in this field.. amul jani
What is the use of hooks?
What is php form validation?
What are the advantages of stored procedures in php?
What is the mysql injection?
What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?
Is php faster than javascript?