Sometimes you need just the filename of the current script, without the path. This snippet does just that using the SCRIPT_NAME and explode function.
Quote:
<?
$currentFile = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentFile);
$currentFile = $parts[count($parts) - 1];
?>
|