How to get current executing file script name in PHP

How to detect and show currently running php script page name with extension.

In this tutorial we are simply getting current time running php file name and displaying that name on screen. So here is the complete step by step tutorial for How to get current executing file script name in PHP .

android-project-download-code-button

How to get current executing file script name in PHP.

Code for current-filename.php file .

 <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Getting currently executing only file itself name in php</title>
</head>

<body>

<?php 

$FileURL = $_SERVER["SCRIPT_NAME"];

$Cut = Explode('/', $FileURL);

$FileCut = $Cut[count($Cut) - 1];

echo $FileCut; 

?>

</body>
</html>

Screenshot:

get current executing file script name in PHP

Click here to download How to get current executing file script name in PHP project file with source code.