显示下拉菜单

define()

« decoct | defined »
<?php
$bool 
define (
    
// string $name
    
// mixed $value
    
?  // [bool $case_insensitive = false]
);

// shows if the constant is defined regardless of the case
// note that $name below actually represents an argument
if ($bool) {
    
$is_defined defined(strtolower($name));
}
?>
结果
$bool = true
$is_defined = false
示例
#1 define  ("CONSTANT",
 
"Hello world.")
#2 define  ("GREETING",
 
"Hello you.",
 
true)
#3 define  ("E_ALL",
 
"123")
#4 define  ("ARRAY",
 [
=> 123])
另请参阅
constant, defined, get_defined_constants, get_defined_functions, get_defined_vars, strtolower