How can I get the only name of the current executing file?

Answer Posted / sudeb mandal

<?php
//To get current file name.
$file = $_SERVER["SCRIPT_NAME"];
echo $file;

?>

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to check an key is exists in array?

555


What are different types of Print Functions available in PHP?

530


What is the difference between file_get_contents() and file_put_contents() in php?

679


What is the difference between get and post method in php?

503


How do we get the current session id?

556






How do you trim spaces in excel?

517


Which function is used in php to count the total number of rows returned by any query?

527


Can a super () and this () keywords be in same constructor?

487


Can we extend two classes in php?

525


Is php the same as html?

550


How to download file in php?

553


What is magic function in php?

544


What is in php 7?

559


What is meant by variable variables in php?

533


What are the advantages of oops in php?

563