Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP defined() Function

PHP defined() Function

PHP Misc Reference Manual PHP Misc Reference Manual

Example

Check whether a constant exists:

Run Example »


Definition and Usage

The defined() function checks whether a constant exists.


Syntax

defined(

name

)

Parameters Description
name Required. Specifies the name of the constant to check.

Technical Details

Return Value: Returns TRUE if the constant exists, otherwise FALSE.
PHP Version: 4+

PHP Misc Reference Manual PHP Misc Reference Manual