Get class constants list [closed]

Jack1994

New Member
I have several CONST's defined on some classes, and want to get a list of them. For example:\[code\]class Profile { const LABEL_FIRST_NAME = "First Name"; const LABEL_LAST_NAME = "Last Name"; const LABEL_COMPANY_NAME = "Company";}\[/code\]Is there any way to get a list of the CONST's defined on the \[code\]Profile\[/code\] class? As far as I can tell, the closest option(\[code\]get_defined_constants()\[/code\]) won't do the trick.What I actually need is a list of the constant names - something like this:\[code\]array('LABEL_FIRST_NAME', 'LABEL_LAST_NAME', 'LABEL_COMPANY_NAME')\[/code\]Or:\[code\]array('Profile::LABEL_FIRST_NAME', 'Profile::LABEL_LAST_NAME', 'Profile::LABEL_COMPANY_NAME')\[/code\]Or even:\[code\]array('Profile::LABEL_FIRST_NAME'=>'First Name', 'Profile::LABEL_LAST_NAME'=>'Last Name', 'Profile::LABEL_COMPANY_NAME'=>'Company')\[/code\]
 
Back
Top