PHP: get current filename as variable on September 25, 2011 Get link Facebook Twitter Pinterest Email Other Apps <?php $currentFile = $_SERVER["SCRIPT_NAME"]; $parts = Explode('/', $currentFile); $currentFile = $parts[count($parts) - 1]; $currentFile = "\"in_".$currentFile."\""; echo $currentFile; ?>