All defined constants

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ngungo
Forum Commoner
Posts: 75
Joined: Thu Jun 08, 2006 10:45 pm

All defined constants

Post by ngungo »

Is there any easy way to echo (the name and value of ) all defined constants? Thanks.
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: All defined constants

Post by Mark Baker »

get_defined_constants()
You can then loop through the array with the constant() function
Post Reply