app/Functions/Functions.php
public static function getCont($nlevel, $nrec): string
    {
        $text = '';

        $subrecords = explode("\n", $nrec);
        foreach ($subrecords as $thisSubrecord) {
            if (substr($thisSubrecord, 0, 2) !== $nlevel . ' ') {
                continue;
            }
            $subrecordType = substr($thisSubrecord, 2, 4);
            if ($subrecordType === 'CONT') {
                $text .= "\n" . substr($thisSubrecord, 7);
            }
        }

        return $text;
    }
public static function getCont($nlevel, $nrec): string
    {
        $text = '';

        $subrecords = explode("\n", $nrec);
        foreach ($subrecords as $thisSubrecord) {
            if (substr($thisSubrecord, 0, 2) !== $nlevel . ' ') {
                continue;
            }
            $subrecordType = substr($thisSubrecord, 2, 4);
            if ($subrecordType === 'CONT') {
                $text .= "\n" . substr($thisSubrecord, 7);
            }
        }

        return $text;
    }
public static function getCont ( $ nlevel , $ nrec ) : string { $ text = '' ; $ subrecords = explode ( "\n" , $ nrec ) ; foreach ( $ subrecords as $ thisSubrecord ) { if ( substr ( $ thisSubrecord , 0 , 2 ) !== $ nlevel . ' ' ) { continue ; } $ subrecordType = substr ( $ thisSubrecord , 2 , 4 ) ; if ( $ subrecordType === 'CONT' ) { $ text .= "\n" . substr ( $ thisSubrecord , 7 ) ; } } return $ text ; }
get CONT lines

get the N+1 CONT or CONC lines of a gedcom subrecord

@param int    $nlevel the level of the CONT lines to get
@param string $nrec   the gedcom subrecord to search in

@return string a string with all CONT lines merged
get CONT lines