Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

which function used to get the file name in php?

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


Please Help Members By Posting Answers For Below Questions

Explain about PHP cookies?

1049


What is super keyword in c++?

1002


How do you find the length of a string in php?

978


What are the advantages of oops in php?

1069


What is the use of session and cookies in php?

988


Explain how can php and javascript interact?

1030


How to randomly retrieve a value from an array?

1085


How to include a file code in different files in php?

1095


What is php7?

1066


What is the correct php command to use to catch any error messages within the code?

1066


Explain the difference between static and dynamic websites?

986


How does session work in php?

1005


Is php 5 still supported?

981


What is $_session in php?

996


How can I embed a java program in php file and what changes have to be done in php.ini file?

960