我有一个 Mailchimp 单选按钮设置为是/否。我在用这样的东西从 PHP 测试它的价值时遇到了麻烦......
function draw_results_detail ($hitNum) {
$result = '';
if ($hitNum >= count($_SESSION['hitList'])) return $result;
if ($hitNum < 0) return $result;
$aHit = $_SESSION['hitList'][(int) $hitNum];
$result .= sprintf(
"%s %s<h2>%s %s</h2>",
$aHit->membership,
$aHit->affiliation,
htmlspecialchars(capitalize_scrub($aHit->fname)),
htmlspecialchars(capitalize_scrub($aHit->lname))
);
if (FALSE !== strpos(strtolower($aHit->unlisted),'yes')) {
$result .= "<p>Email address and telephone number are unlisted.</p>";
} else {
$result .= sprintf(
"<p>Email: <a href=\"mailto:%s\">%s<a/>" .
"<br/>Phone: %s</p>",
htmlspecialchars(strtolower($aHit->email)),
htmlspecialchars(strtolower($aHit->email)),
htmlspecialchars(strtolower($aHit->phone))
);
}
$temp = $aHit->modified;
if ($temp != '') {
$result .= "<span style=\"font-size:10px;\">(last modified: $temp UTC)</span>";
}
$temp = count($_SESSION['hitList']);
$hitNum += 1;
$result .= "<span style=\"font-size:10px;\"> [$hitNum of $temp]</span>";
return $result;
}
中央 IF 语句未能触发。如果我“var_dump”$aHit,“未列出”键是 String(0),即使 Mailchimp 显示相应记录的按钮已选择为是。
如何从 Mailchimp 测试按钮设置?