- 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
define() function in PHP
The define() function defines a constant.
Syntax
define(const_name,value,case_insensitive)
Parameters
const_name − The name of the constant.
value − The value of the constant.
case_insensitive − The constant name should be case-insensitive.
Return
The define() function returns true on success or false on failure.
Example
The following is an example that defines a constant.
<?php define("message","This is it!"); echo constant("message"); ?>
Ouptut
The following is the output.
This is it!
Advertisements