function getSubfield($code = null, $pcre = null)
    {
        // iterate merrily through the subfields looking for the requested code
        foreach ($this->subfields as $sf) {
            if (($pcre
                && preg_match("/$code/", $sf->getCode()))
                || (!$pcre
                && $code == $sf->getCode())
            ) {
                return $sf;
            }
        }

        // No matches were found
        return false;
    }
function getSubfield($code = null, $pcre = null)
    {
        // iterate merrily through the subfields looking for the requested code
        foreach ($this->subfields as $sf) {
            if (($pcre
                && preg_match("/$code/", $sf->getCode()))
                || (!$pcre
                && $code == $sf->getCode())
            ) {
                return $sf;
            }
        }

        // No matches were found
        return false;
    }
function getSubfield ( $ code = null , $ pcre = null ) { // iterate merrily through the subfields looking for the requested code foreach ( $ this -> subfields as $ sf ) { if ( ( $ pcre && preg_match ( "/$code/" , $ sf -> getCode ( ) ) ) || ( ! $ pcre && $ code == $ sf -> getCode ( ) ) ) { return $ sf ; } } // No matches were found return false ; }
Returns the first subfield that matches a requested code.

@param string $code subfield code for which the
{@link File_MARC_Subfield} is retrieved
@param bool   $pcre if true, then match as a regular expression

@return File_MARC_Subfield returns the first subfield that matches
$code, or false if no codes match $code
Returns the first subfield that matches a requested code .