1 回答
TA贡献2080条经验 获得超4个赞
只需在循环外打开和关闭您的桌子
$tableStr .= "<tr>";
$tableStr .= "<td><select name='selectAccounts' id='selectAccounts'>";
foreach ($mgrAccounts as $mgrAccount) {
$mgrAccNames = $mgrAccount['account_name'];
$userAccNames = $userRow['account_name'];
$userAccNames = explode(',', str_replace(['{', '}', '"'], "", $userAccNames));
$mgrAccNames = explode(',', str_replace(['{', '}', '"'], "", $mgrAccNames));
$accounts = array_intersect($userAccNames, $mgrAccNames);
if (!empty($accounts)) {
foreach ($accounts as $account) {
$tableStr .= "<option>{$account}</option>";
}
}
}
$tableStr .= "</select></td>";
$tableStr .= "<td><a href='/reset_password.php'>Password Reset</a>
</td>";
$tableStr .= "</tr>";
- 1 回答
- 0 关注
- 236 浏览
添加回答
举报