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?

Answers were Sorted based on User's Feedback



which function used to get the file name in php?..

Answer / simran

The file name on the browser system
$file_name=$_FILES[$fieldName]['name'];

Is This Answer Correct ?    8 Yes 0 No

which function used to get the file name in php?..

Answer / lakshmi

<?php
$path = "/home/httpd/html/index.php";
$file = basename($path);
$file = basename($path, ".php");
?>

Is This Answer Correct ?    4 Yes 0 No

which function used to get the file name in php?..

Answer / naga

$parts = Explode('/', $_SERVER["SCRIPT_NAME"]);
$currentFile = $parts[count($parts) - 1];

Is This Answer Correct ?    1 Yes 1 No

which function used to get the file name in php?..

Answer / jaimin desai

$file_name=$_FILES[$ControlName]['name'];

Is This Answer Correct ?    0 Yes 0 No

which function used to get the file name in php?..

Answer / 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

More PHP Interview Questions

What is the advantge and disadvantage of mysql_connet() and mysql_pconnect() ? in which condition will you use mysql_connect() and mysql_pconnect().

2 Answers   Avanigoradia,


Is salary a ratio or interval?

0 Answers  


What is var_dump function in php?

0 Answers  


Why do we show php code in browser?

0 Answers  


What does the expression exception::__tostring means?

0 Answers  


display selected value in dropdown list through javascript without page refresh

5 Answers   ASD Lab,


How can you execute php script from the command line?

0 Answers  


What is the use of explode() function?

0 Answers  


What is the diffrence between GET,POST and REQUEST Method.

7 Answers   Acquity Software,


What is overloading in php?

0 Answers  


How do I escape in php?

0 Answers  


Does csrf token change?

0 Answers  


Categories