得到脚本名字如何弄啊

WBOY
Release: 2016-06-13 13:53:41
Original
1075 people have browsed it

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


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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template