Forum : PHP Constant
Brief description  about Online courses   join in Online courses
View Karm jeet singh 's Profile

PHP Constant

1.how will check whether one constant is already defined or not?
2.
Asked by Karm jeet singh | Nov 19, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Karmjeet singh,

by using 'defined' function we can check whether one constant is already defined or not,

for example

if(defined(someconstant)) {
// do something when it is defined
}
else {
// do something else because it isn't
}
Nov 19, 2010