$ 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 );
If
Echo basename (PHP_SELF)
Displayed as index. php
If
Echo basename (PHP_SELF, '. php ')
Displayed as: index
Articles you may be interested in
- Php searches for the existence of a value in the 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... solution to the error
- PHP reports Fatal error Allowed memory size of... how should we solve the problem of insufficient memory?
- PHP string escape functions (addslashes, stripslashes)
- Php prompts PHP Warning: date (): It is not safe to rely on the... solution to the error
- Use break, continue, goto, return, and exit in multiple loops in PHP
- Php string replacement function str_replace is faster than preg_replace