

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
- Related Questions & Answers
- PHP User-defined functions
- Is it possible to get list of defined namespaces in PHP
- How to use Pre-defined mathematical function in C language?
- file_exists() function in PHP
- basename( ) function in PHP
- chgrp()function in PHP
- chmod() function in PHP
- chown() function in PHP
- clearstatcache() function in PHP
- copy() function in PHP
- delete() function in PHP
- dirname()function in PHP
- disk_free_space() function in PHP
- disk_total_space() function in PHP
- diskfreespace() function in PHP
Advertisements