Query: define
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
DEFINE(3) 1 DEFINE(3) define - Defines a named constantSYNOPSISbool define (string $name, mixed $value, [bool $case_insensitive = false])DESCRIPTIONDefines a named constant at runtime.PARAMETERSo $name - The name of the constant. o $value - The value of the constant; only scalar and null values are allowed. As of PHP 7 it also possible to use array value. Scalar val- ues are integer, float, string or boolean values. It is possible to define resource constants, however it is not recommended and may cause unpredictable behavior. o $case_insensitive - If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Con- stant represent different values. Note Case-insensitive constants are stored as lower-case.RETURN VALUESReturns TRUE on success or FALSE on failure.CHANGELOG+--------+---------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------+ | 7.0.0 | | | | | | | | | | array values are allowed. | | | | +--------+---------------------------+EXAMPLESExample #1 Defining Constants <?php define("CONSTANT", "Hello world."); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Constant" and issues a notice. define("GREETING", "Hello you.", true); echo GREETING; // outputs "Hello you." echo Greeting; // outputs "Hello you." // Works as of PHP 7 define('ANIMALS', array( 'dog', 'cat', 'bird' )); echo ANIMALS[1]; // outputs "cat" ?>SEE ALSOdefined(3), constant(3), The section on Constants. PHP Documentation Group DEFINE(3)
Related Man Pages |
---|
is_int(3) - php |
version_compare(3) - php |
com_load_typelib(3) - php |
constant(3) - php |
is_string(3) - php |
Similar Topics in the Unix Linux Community |
---|
Comparing two strings those are outputs of echo |
Question about cat and echo |
What in the world does $$ mean? |
Trim not constant number of symbols ? |
String Constant C |