Sherida van den Bent Sherida van den Bent - 9 days ago 6
PHP Question

PHP: undefined constant while defining it

I'm getting the following error in PHP:


Notice: Use of undefined constant CONSTANT


on the exact line where I define it:

define(CONSTANT, true);


What am I doing wrong? I defined it, so why does it say "Undefined constant"?

Answer

You need to quote the string which becomes a constant

define('CONSTANT', true);
Comments