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)) {
$tableStr .= "<tr>";
$tableStr .= "<td><select name='selectAccounts' id='selectAccounts'>";
foreach ($accounts as $account) {
$tableStr .= "<option>{$account}</option>";
}
$tableStr .= "</select></td>";
$tableStr .= "<td><a href='/reset_password.php'>Password Reset</a></td>";
$tableStr .= "</tr>";
}
}
我需要能够将每个帐户的下拉列表作为其中的一个选项。目前,它正在为每个帐户创建一个新选项。如何将所有内容组合在一起以放入选项下拉列表?
犯罪嫌疑人X