How to use defined in PHP

In this article I will explain how defined Function can be used in PHP.
  • 1697

defined() Function

This function checks whether a constant exists.

Returns TRUE if the constant exists, or FALSE otherwise.

Syntax

defined(name)

 

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

Example

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

 

Output

defined-php.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.