View Single Post
  #1   IP: 61.139.126.97
Old 2006-10-18, 12:31 AM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default 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];
?>
Reply With Quote