得到脚本名字怎么弄啊?
假如我当前脚本是:index.php
我要得到index
怎么弄?
------解决方案--------------------
basename();
看看手册
------解决方案--------------------
$str = "index.php ";
$str = strsub($str,0,-4);//从首位开始取到倒数第四位,也就是取出.php之前的东西!
echo $str;
又或者用字符串分割!不过我觉得那麻烦!
------解决方案--------------------
$_SERVER[ 'SCRIPT_FILENAME ']
------解决方案--------------------
basename($_SELF, '.php ')
------解决方案--------------------
同上
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号