$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" => empty($r["name"]) ? null : $r["name"], "email" => empty($r["email"]) ? null : $r["email"], "location" => empty($r["location"]) ? null : $r["location"], "commissionexpires" => (is_null($r["commissionexpires"]) ? null : strtotime($r["commissionexpires"])), "idnumber" => empty($r["idnumber"]) ? null : $r["idnumber"], "state" => empty($r["state"]) ? null : $r["state"], "publickey" => $r["publickey"] ]; } exitWithJson([ "status" => "OK", "query" => $fp, "count" => count($results), "results" => $out ]);