$contactId = 123; // Replace with the actual contact ID $contact = CRM_Contact_BAO_Contact::retrieve($contactId); // Access information about the contact $name = $contact->first_name . ' ' . $contact->last_name; $email = $contact->email; $address = $contact->street_address;
$fields = CRM_Contact_BAO_Contact::describeFields(); // Loop through the fields and print their details foreach ($fields as $fieldName => $fieldDetails) { echo "Field name: $fieldName\n"; echo "Field label: {$fieldDetails['title']}\n"; echo "Field type: {$fieldDetails['type']}\n"; }The CRM_Contact_BAO_Contact class is part of the CiviCRM package library. CiviCRM is an open source CRM system for managing contacts and relationships with constituents such as donors, volunteers, and members.