define('VAR_1', 'Some info 01');
define('VAR_2', 'Some info 02');
define('VAR_3', 'Some info 03');
define('VAR_4', 'Some info 04');
define('VAR_5', 'Some info 05');
define('VAR_6', 'Some info 06');
define('VAR_7', 'Some info 07');
define(‘VAR_1’, ‘Some info 01’); define(‘VAR_2’, ‘Some info 02’); define(‘VAR_3’, ‘Some info 03’); define(‘VAR_4’, ‘Some
Share
I usually namespace my constants, if I’ve got many of them, in a class like so:
Putting an Array in a constant is not possible for class constants, and I don’t think it is a good practice putting them in global constants either, if it is even possible (not sure). Maybe you should tell us what you are trying to accomplish, maybe there is a better way to do it.
Oh, and please don’t do something like this:
Which has been suggested here, but IMHO this is absolutely not how constant are supposed to be used.