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

What is the difference between array_merge() and array_merge_recursive() in php?

1001


Define anonymous classes in php7?

978


What is mysql_fetch_object?

986


What is smarty?

897


What does $globals mean?

914


Why session timeout is important?

1053


How to return a value back to the function caller?

959


How can you associate a variable with a session?

964


Explain me what is the meaning of a persistent cookie?

948


Is rent a variable cost?

898


What are the benefits of using queries?

1061


how to use http headers inside php? Write the statement through which it can be added?

970


Explain about switch statement in PHP?

968


What is the difference between for and foreach loop in php?

1036


Is php object oriented?

871