$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);
Copy after login
If
echo basename(PHP_SELF)
Copy after login
is displayed as: index.php
If
echo basename(PHP_SELF,'.php')
Copy after login
Displayed as: index
Articles you may be interested in
- php finds whether a value exists in an array (in_array(), array_search(), array_key_exists() )
- phpMyAdmin Cannot start session without errors error solution
- php prompts Maximum execution time of 30 seconds exceeded... Error solution
- PHP reports Fatal error Allowed memory size of...How to solve the out of memory error
- Detailed explanation of PHP string escape functions (addslashes, stripslashes)
- php prompt PHP Warning: date(): It is not safe to Rely on the... Error solution
- The usage and difference of using break, continue, goto, return, exit to break out of multiple loops in PHP
- php string replacement function str_replace Faster than preg_replace
http://www.bkjia.com/PHPjc/764199.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764199.htmlTechArticle$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);...