You are here

function Field::subfield in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/marcParse/php-marc.php \Field::subfield()
  2. 6 marcParse/php-marc.php \Field::subfield()
  3. 7 modules/marcParse/php-marc.php \Field::subfield()

Get the value of a subfield

Return of the value of the given subfield, if exists

Parameters

string Name of subfield:

Return value

string|FALSE Value of the subfield if exists, otherwise FALSE

File

modules/marcParse/php-marc.php, line 872

Class

Field
Field Class Create a MARC Field object

Code

function subfield($code, $repeatable = FALSE) {
  if (array_key_exists($code, $this->subfields)) {
    return $repeatable ? $this->subfields[$code] : $this->subfields[$code][0];
  }
  else {
    return $repeatable ? array() : FALSE;
  }
}