which function used to get the file name in php?

Answer Posted / naga

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

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable and data type?

513


What is the difference between Split and Explode in PHP?

574


What is the use of "echo" in php?

535


Does php 7 support multiple inheritance?

514


Explain how can php and javascript interact?

546






Which function is used in php to delete a file?

558


What is isset in php form?

533


How to make database connection in php?

535


How to call a php function from html button?

611


How to get ip address of clients machine?

559


What is the difference between html and php?

544


What is session expiry?

534


Can a trait extend a class php?

518


How can you upload a file using php?

553


How is csrf token generated?

509