php - Nesting inner array as value in pre-existing multi-dimensional array -
i have array called:
$fragment = array($fragment); which has following 3 values:
["<div class=\"alert alert_error mt20\"><a class=\"js-alert-close close\"><\/a>please enter title <\/div>"]["<div class=\"alert alert_error mt20\"><a class=\"js-alert-close close\"><\/a>enter 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 category <\/div>"]
i want merge array array (into 'fragment' key) looks like:
$toreturn = array( 'status' => $status, 'formdata' => $formdata, 'inputs' => $inputs, 'fragment' => $fragment ); but every time so, adds first value of $fragment is:
"<div class=\"alert alert_error mt20\"><a class=\"js-alert-close close\"><\/a>please enter title <\/div>"
how can add 3 values $fragment $toreturn array instead?
you can create 1 long string 3 array entries concatenating them, e.g. popular implodedocs function:
$fragment = implode("", $fragment);
Comments
Post a Comment