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
Is python better than php?
What is ltrim?
What is magic function in php?
Can we override magic methods in php?
Suppose your zend engine supports the mode Then how can you configure your php zend engine to support Mode ?
How is session id stored in browser?
What is the main difference between require() and include()?
What is the meaning of xdebug?
How to Retrieve a Cookie Value?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
Why do we need session?
What is overloading in php?
What do you mean range() in php?
Which is better session or cookie?
What are the differences between GET and POST methods?