1. Custom constants
* Must be defined using the function define()
* After definition, its value cannot be changed
* Use the constant name directly when using it. You cannot add $s
in front like a variable. For example: define("PI",3.14); define a constant
$area = PI*R* R; Calculate the area of a circle
define("URL","http://www.youbml.com");
echo "My URL is:".URL;
2 System constants:
FILE: php program file name
LINE: The number of lines of PHP program files
PHP_VERSION: The version number of the current parser
PHP_OS: The name of the operating system that executes the current PHP version
__FILE__ The name of the script file currently being processed.
__LINE__ The current line number of the script file currently being processed, the same as before.
TRUE represents true value.
FALSE represents a false value (false).
E_ERROR This constant points to the most recent error.
E_WARNING This quantity refers to the nearest warning.
E_PARSE This constant is a potential problem in parsing grammar.
The above is the content of php (6) PHP constants. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!