
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Defined Function in PHP
The defined() function in PHP checks that constant exists or not.
Syntax
defined(name)
Parameters
name− The name of constant.
Return
The defined() function returns true if the constant exists otherwise false.
Example
The following is an example that checks whether a constant exist.
<?php define("myConstant","This is it!"); echo defined("myConstant"); ?>
Output
The following is the output.
1
Advertisements