I display the summary page for a civicrm contact and I need to get the current contact id. Is there any built in function for that?
I have this code where I explicitly refer to the civicrm id 4. Instead of doing that I would like to refer to the current civicrm contact.
$contact_id = 4;
$custom_name = array("custom_2","custom_3","custom_6","custom_7");
$params = array(
'return' => $custom_name,
'version' => 3,
'id' => $contact_id,
);
$result = civicrm_api( 'contact','get',$params );