which function used to get the file name in php?

Answer Posted / lakshmi

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

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the best way to change the key without changing the value of a php array element?

548


What are the advantages of using php?

534


Explain me what is the importance of "method" attribute in a html form?

497


What are interfaces in php?

515


Explain what are the three classes of errors that can occur in php?

524






How do you remove whitespace from the beginning and end of a $string variable?

491


What is the function file_get_contents() useful for?

482


Name some of the constants in php and their purpose.

531


Why php is better?

536


Tell me how can we connect to a mysql database from a php script?

503


What is the use of extract function in php?

504


What are super global variables in php?

521


What is reference variable php?

494


What is the purpose of break and continue statement?

522


What is the difference between get and post in php?

508