In Drupal 7, I have a page content type that has a field called group (so the machine name is field_group). The field is a List (integer) field type.
This field might have allowed values as follows:
0|Description 1
1|Description 2
2|Description 3
If I want to return the key of this field for the current page, the following code correctly works:
field_get_items('node', $node, 'field_group')[0]['value']
If the key were set to 1 for this page, the above code would return 1.
However, is there a way to instead return the associated value (e.g., "Description 1," "Description 2," etc.)?
I thought I had a way to return the value already, but I was told yesterday that my previous method was not a good way to get the value (or key) because my previous method may return extraneous data (such as unwanted HTML), when I really just want the raw key/value itself: How is a field's key (rather than value) obtained?