This little function will return the file name which calls it minus the .php extension.
<?php
function getCurrentFile()
{
$currentFile = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentFile);
$currentFile = substr($parts[count($parts) - 1],0,-4);
return $currentFile;
}
?>
No comments:
Post a Comment