$fp]; } else if (strlen($fp) == 16) { $where = ["fingerprint_short" => $fp]; } else { $where = ["fingerprint[~]" => "%$fp"]; } $results = $database->select("notary_registry", '*', $where); $out = []; foreach ($results as $r) { $out[] = [ "fingerprint" => $r["fingerprint"], "name" => $r["name"], "email" => $r["email"], "location" => $r["location"], "commissionexpires" => (is_null($r["commissionexpires"]) ? null : strtotime($r["commissionexpires"])), "idnumber" => $r["idnumber"], "state" => $r["state"], "publickey" => $r["publickey"] ]; } exitWithJson([ "status" => "OK", "query" => $fp, "count" => count($results), "results" => $out ]);