这就是数组的最终输出应该是这样的
$dataToReset = array (
'email_address' => $subEmail,
'status' => 'subscribed',
'interests' =>
array (
'1111111' => true,
'2222222' => true,
'3333333' => true,
'4444444' => true,
'5555555' => true,
)
);
我想更换以下部分
'interests' =>
array (
'1111111' => true,
'2222222' => true,
'3333333' => true,
'4444444' => true,
'5555555' => true,
)
$interestsAdd有了这样的变量
$dataToReset = array (
'email_address' => $subEmail,
'status' => 'subscribed',
$interestsAdd
);
我得到的值和我尝试过的值如下,但没有成功!
if ($form_data['lbu_multilistsvalue'] !== ''){
$groupsSelected = $form_data['lbu_multilistsvalue'];
$selectedGroups = array_fill_keys(explode(",", $groupsSelected), true);
$interestsAdd = ['interests' => $selectedGroups];
} else {
$interestsAdd = '';
}
LEATH
肥皂起泡泡