日期:2014-05-17  浏览次数:20435 次

得到脚本名字怎么弄啊?
假如我当前脚本是:index.php
我要得到index
怎么弄?


------解决方案--------------------
basename();
看看手册
------解决方案--------------------
$str = "index.php ";
$str = strsub($str,0,-4);//从首位开始取到倒数第四位,也就是取出.php之前的东西!
echo $str;
又或者用字符串分割!不过我觉得那麻烦!
------解决方案--------------------
$_SERVER[ 'SCRIPT_FILENAME ']
------解决方案--------------------
basename($_SELF, '.php ')
------解决方案--------------------
同上