Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从中找到页面标题的名称$_SERVER['php_self']?假设$_SERVER显示我的页面是这样的:/application/mysite/signup.php。如何选择页面标题signup?
$_SERVER['php_self']
$_SERVER
/application/mysite/signup.php
signup
您可以使用basename:
basename
echo basename($_SERVER['php_self'], '.php');
或pathinfo:
pathinfo
$pathInfo = pathinfo($_SERVER['php_self']); echo $pathInfo['filename'];