How to get the list of values and keys for a given list field I want to programmatically get the list of possible key values for a field, along with their labels. For example:

1 =&gt; red
2 =&gt; blue
3 =&gt; Yellow
...


and so on. How do I do that?
It's just a matter of getting the field basic data, then get a list of possible values using Field API function that is part of List module.

$field = field_info_field([FIELD_MACHINE_NAME]); // This one gets the field data
$field_values = list_allowed_values($field); // This one gets an array of values =&gt; labels
$field_key = array_search('red', $show_field_values); // This one gets the key for the value labelled "red", that is: 1