$currentFile = $_SERVER["SCRIPT_NAME"]; $parts = Explode('/', $currentFile); print $parts[count($parts)];