$contactTypes = CRM_Core_PseudoConstant::get('CRM_Contact_BAO_Contact', 'contact_type'); foreach ($contactTypes as $key => $value) { echo $key . ': ' . $value . '
'; }
$activityTypes = CRM_Core_PseudoConstant::activityType(); foreach ($activityTypes as $key => $value) { echo $key . ': ' . $value . 'This will output a list of activity types like "Meeting", "Phone Call", and "Email". Overall, the CRM_Core_PseudoConstant group is a useful package in the CiviCRM library for retrieving lists of constants in a consistent and easy-to-use way.
'; }