$familyname = trim(str_replace('"', '', $bits[0])); $firstname = trim(str_replace('"', '', $bits[1])); $middlename = trim(str_replace('"', '', $bits[2])); $suffix = trim(str_replace('"', '', $bits[3])); $name = trim(str_replace('"', '', $bits[4])); $living = trim(str_replace('"', '', $bits[5])); $startyear = trim(str_replace('"', '', $bits[6])); $endyear = trim(str_replace('"', '', $bits[7])); if (count($bits) > 8) { $others = trim(str_replace('"', '', $bits[8])); } echo "{$name} ({$startyear}-{$endyear}) "; $prefix = null; $guid = null; $notes = null; $result = $am->addAgentsFromPartsIfNotExistExt($name, $prefix, $firstname, $middlename, $familyname, $suffix, $startyear, $endyear, $living, $notes, $guid); if ($debug) { print_r($result); } $agentid = $result['agentid']; if (strlen($others) > 0 && strlen($agentid) > 0) { $otherbits = explode("|", $others); foreach ($otherbits as $otherbit) { $othername = explode(":", $otherbit); $an = new agentnames(); $an->setagentid($agentid); $type = $othername[0]; // TODO: Add full range of types. if ($type == "standard" || $type == "Standard Abbreviation") { $an->setType('Standard Abbreviation'); } elseif ($type == "First Initials Last") {