Sherida van den Bent Sherida van den Bent - 10 months ago 91
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 Source

You need to quote the string which becomes a constant

define('CONSTANT', true);