X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP defined() Function

PHP Misc Reference PHP Misc Reference

Example

Check if a constant exists:

<?php
define("GREETING","Hello you! How are you today?");
echo defined("GREETING");
?>

Run example »

Definition and Usage

The defined() function checks whether a constant exists.


Syntax

defined(name)

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

Technical Details

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


PHP Misc Reference PHP Misc Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook