我有一个名为:
$fragment = array($fragment);
其中有以下三个值:
["<div class=\"alert alert_error mt20\"><a class=\"js-alert-close close\"><\/a>Please enter a title <\/div>"]
["<div class=\"alert alert_error mt20\"><a class=\"js-alert-close close\"><\/a>Enter a valid source URL (e.g. http:\/\/en.wikipedia.org\/wiki\/Penguins) <\/div>"]
["<div class=\"alert alert_error mt20\"><a class=\"js-alert-close close\"><\/a>Please choose a category <\/div>"]
我想将该数组合并到另一个数组(到'fragment'
键中),如下所示:
$toReturn = array(
'status' => $status,
'formData' => $formData,
'inputs' => $inputs,
'fragment' => $fragment
);
但每次我这样做时,它只会添加第一个值$fragment
:
"<div class=\"alert alert_error mt20\"><a class=\"js-alert-close close\"><\/a>Please enter a title <\/div>"
如何将所有三个值添加$fragment
到我的$toReturn
数组中?