Home Menu

defined

Checks whether a given named constant exists

Syntax

defined ( string $name ) : bool

Parameters

name

The constant name.

Return

Returns TRUE if the named constant given by name has been defined, FALSE otherwise.

Examples

1

<?

define("MYCONSTANT", "Hello World!");

$return = defined("MYCONSTANT");

var_export($return);

?>
true

2

<?

$return = defined("MYCONSTANT");

var_export($return);

?>
false

PHP

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms