Recent Posts

How to solve: Notice: Use of undefined constant XXX - assumed 'XXX'

This notice occurs when a token is used in the code and appears to be a constant, but a constant by that name is not defined.
One of the most common causes of this notice is failure to quote a string used as an associative array key.
For example:
// Wrong
echo $array[key];

// Right
echo $array['key'];
Another common causes is a missing $ (dollar) sign in front of a variable name:
// Wrong
echo varName;

// Right
echo $varName;
It can also be a sign that a needed PHP extension or library is missing when you try to access a constant defined by that library.

No comments:

Post a Comment