How to get all the checkbox value in the form array values to one key?

Hi all. The question all is clear.
There is a form that has a checkbox-s,
<input type="checkbox" name="bulk_category[]" value="'1'" /><input type="checkbox" name="bulk_category[]" value="'2'" />

post if you go data in an array
array(2) { [0]=> string(2) "15" [1]=> string(1) "4" }

How do I make preserved under a certain key in the array and the values, sort of
array(2) { ['test']=> string(2) "15, 5" }

I tried to put
<input type="checkbox" name="bulk_category['test']" value="'1'" /><input type="checkbox" name="bulk_category['test']" value="'2'" />
doesn't help, the values are overwritten.

Tried this array to obtain and to merge with others using array_merge, too crooked to sit down.

PS something I tuplyu today and can't figure out
April 7th 20 at 11:07
1 answer
April 7th 20 at 11:09
So work form. Either a single value or an array thereof. If you want a custom representation of the data to write is already on the server, after receiving the array something like :

$myNewArray = ['test'=> implode(",", $bulk_category) ];
Want the answer? Formulate a question CORRECTLY ! :)
Well, if the question is stupid, our cheerful answered still needs to show everyone that he knows the function implode - abdullah.Haley48 commented on April 7th 20 at 11:12
@garland.OKeefe, ? - Antoinette54 commented on April 7th 20 at 11:15

Find more questions by tags PHP