So I simply want to count the number of tags on a term reference field.. I've tried a count (below) and it simply returns "1" (there are a lot more terms tagged than 1):
$entity_field[0]['value'] = count($entity->field_termref);
Also something like below does not work either and also returns "1" - I'm thinking I have to loop through the multiple tags somehow but I'm not sure how to do it. Thanks a lot for any help.
$myterms = array();
foreach($entity->field_guests as $tmp) {
$myterms[] = $tmp_field_term;
}
$entity_field[0]['value'] = count($myterms);