$php_self = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; if ('/' == substr($php_self, -1)){ $php_self .= 'index.php'; } define('PHP_SELF', $php_self);
如果
echo basename(PHP_SELF)
显示为:index.php
如果
echo basename(PHP_SELF,'.php')
显示为:index
您可能感兴趣的文章
- php在数组中查找某个值是否存在(in_array(),array_search(),array_key_exists())
- phpMyAdmin Cannot start session without errors错误解决办法
- php提示Maximum execution time of 30 seconds exceeded...错误的解决办法
- PHP报Fatal error Allowed memory size of...内存不足的错误应该如何解决
- PHP 字符串转义函数(addslashes,stripslashes)详解
- php提示PHP Warning: date(): It is not safe to rely on the......错误的解决办法
- PHP中跳出多重循环使用break,continue,goto,return,exit的用法和区别
- php字符串替换函数str_replace速度比preg_replace快

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
