<?php
bool define ( str $name , mix $value [,
bool $case_insensitive = FALSE ] );
where,
$name = Name of the CONSTANT to be created
$value = Value assigned to the CONSTANT
$case_insensitive = To control whether
UPPERCASE or lowercase
can be used interchangeably
for a same CONSTANT name
Deprecated since PHP 7.3.0 and
$case_insensitive = TRUE
is no longer supported in PHP 8.0.0
?>
VALUE | WHAT DOES |
FALSE | The CONSTANT name will be CASE SENSITIVE |
TRUE | The CONSTANT name will be CASE INSENSITIVE Deprecated since PHP 7.3.0 and is no longer supported in PHP 8.0.0 |
ed48 |
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOME STRING USER-DEFINED
CONSTANT EXAMPLES
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
define('STR01A',
"STRING DELIMITED BY DOUBLE QUOTATION MARKS");
define('STR01B',
'STRING DELIMITED BY SINGLE QUOTATION MARKS',
true);
define("vl01C",
'STRING DELIMITED BY SINGLE "QUOTATION MARKS"');
define('ale01D',
"STRING DELIMITED BY DOUBLE 'QUOTATION MARKS'",
TRUE);
define('RQUO',
" » ",
FALSE);
define('STR01E',"1AnVXY234");
define('nbr01F',"1234567");
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This exercise, if executed,
will issue a Warning in the
examples where $case_insensitive = TRUE,
as this is deprecated since php 7.3.0
and is no longer supported in php 8.0.0.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
?>
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOME USER-DEFINED
ARRAY VARIABLE EXAMPLES
COMMON UNIDIMENSIONAL
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$arr02 = [ 2, 8, '18', 32, 'THIRTY-TWO', "eighteen", 8 ];
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOME USER-DEFINED
ARRAY CONSTANT EXAMPLES
COMMON UNIDIMENSIONAL
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
define('VALR02A', $arr02, true);
define('VALR02B', [01023, 0B0011, 0x20b]);
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This exercise, if executed,
will issue a Warning in the
examples where $case_insensitive = TRUE,
as this is deprecated since php 7.3.0
and is no longer supported in php 8.0.0.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
?>
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOME NUMERIC USER-DEFINED
CONSTANT EXAMPLES
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// DECIMAL NOTATION
define('KONST03A', 123456789);
// OCTAL NOTATION ->
// -> (1023)base 8 = (531)base 10
define('KONST03B', 0123);
// HEXADECIMAL NOTATION ->
// -> (20b)base 16 = (20B)base 16 = (523)base 10
define('KONST03C', 0X20B);
// BINARY NOTATION ->
// -> (0011)base 2 = (3)base 10
define('KONST03D', 0b0011);
// Available since PHP 5.4.0
?>
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOME USER-DEFINED
CONSTANT EXAMPLES
TO BE USED NEXT TO
THE EXERCISES OF THIS SERIES
IF YOU PREFER,
YOU CAN USE OTHER DIRECTORIES
OTHER THAN INDICATED
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
define ("PATH2AN", 'H://WEB/adds/');
// The PATH to adds DIRECTORY
define ("PATH2AW", 'file://H://WEB/adds/');
// The PATH to adds
// DIRECTORY using STREAM WRAPPER
define ("PATH2TN", 'H://WEB/temp/');
// The PATH to temp DIRECTORY
define ("PATH2TW", 'file://H://WEB/temp/');
// The PATH to temp
// DIRECTORY using STREAM WRAPPER
define ("PATH2SN", 'H://WEB/SSL/');
// The PATH to SSL DIRECTORY
define ("PATH2SW", 'file://H://WEB/SSL/');
// The PATH to SSL
// DIRECTORY using STREAM WRAPPER
define ("PATH2FN", 'H://WEB/files/');
// The PATH to files DIRECTORY
// Often used in this tutorial
define ("PATH2FW", 'file://H://WEB/files/');
// The PATH to files
// DIRECTORY using STREAM WRAPPER
// Often used in this tutorial
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note that no name assigned
to the constants can be repeated
with other values.
If this occurs you will be notified.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
?>