It depends on what .php document you're in - if you're in item.php, or the category-item.php files, the following should work.
In the top of the document, add this code:
<!-- Call to prepare extra fields --> <?php $extrafields = array(); foreach($this->item->extra_fields as $item) { $extrafields[$item->id] = $item->value; } ?>
Then, wherever you'd like to call the value of the filled in field, use this:
<?php if($extrafields[ID_NUMBER_OF_FIELD]!=''):?> <!-- if filled in, then call data --> <?php echo $extrafields[ID_NUMBER_OF_FIELD];?> <!-- actual data call --> <?php endif; ?>
tag.php works a little differently, as does the K2 Modules.
tag.php - you don't need the extra code in the head, the following will call your field data.
<?php $extrafields = json_decode($item->extra_fields);?> <?php foreach($extrafields as $key=>$value): ?> <?php if($extrafields[$key]->id == 'ID_NUMBER_OF_FIELD'&&$extrafields[$key]->value!=''): ?> <?php echo $extrafields[$key]->value; ?>, <?php endif; ?> <?php endforeach; ?>
Again, with the module_k2_content, you don't need the top data call. Get your field data this way:
<?php echo $item->extraFields->ALIAS_OF_FIELD->value ;?>
Hope that helps.