网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   代码交流 (https://www.0058.net/forumdisplay.php?f=16)
-   -   get current filename as variable (https://www.0058.net/showthread.php?t=1596)

topvip 2006-10-18 12:31 AM

get current filename as variable
 
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];
?>


All times are GMT +8. The time now is 06:29 PM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.