时间:2021-07-01 10:21:17 帮助过:5人阅读
$php_self = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; if ('/' == substr($php_self, -1)){ $php_self .= 'index.php'; } define('PHP_SELF', $php_self);
如果
echo basename(PHP_SELF)
显示为:index.php
如果
echo basename(PHP_SELF,'.php')
显示为:index
http://www.bkjia.com/PHPjc/764199.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/764199.htmlTechArticle$php_self = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];if ('/' == substr($php_self, -1)){ $php_self .= 'index.php';}define('PHP_SELF', $php_self);...