- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
constant() function in PHP
The constant() function returns the value of a constant.
Syntax
constant(const)
Parameters
const − The name of the constant to check
Return
The constant() function returns the value of a constant and NULL if the constant is not defined.
Example
The following is an example that defines a constant.
<?php define("myConstant","This is it!"); echo constant("myConstant"); ?>
Output
The following is the output.
This is it!
Advertisements