如何从
$_SERVER['php_self']
假设
$_SERVER
/application/mysite/signup.php
如何选择页面标题
signup
您可以使用
basename
echo basename($_SERVER['php_self'], '.php');
或
pathinfo
$pathInfo = pathinfo($_SERVER['php_self']); echo $pathInfo['filename'];