Page 1 of 1

array?

Posted: Sun Jan 16, 2005 9:22 pm
by pinehead18
I have a checkbox area that allows a person to select 8 differnt options. all the check boxes have the same variable name. How do i get that one variable to list all the selected check boxes in that one name?

is that an array if so what type?

thank you

Posted: Sun Jan 16, 2005 9:23 pm
by feyd

Code: Select all

<input type="checkbox" name="your_array_name&#1111;]" value="larry" />
<input type="checkbox" name="your_array_name&#1111;]" value="moe" />
<input type="checkbox" name="your_array_name&#1111;]" value="curly" />
<input type="checkbox" name="your_array_name&#1111;]" value="shemp" />

Posted: Mon Jan 17, 2005 4:16 am
by pinehead18
$music_array = array('music[0]');
$music = implode(',', $music_array);

Ok i had music[] and then i changed it to music[0]

however, this does not work. What i'm trying to accomplish is to seperate all the "values" in the "name" with a comma.

Thanks for the help.

Posted: Mon Jan 17, 2005 7:42 am
by feyd

Code: Select all

$commas = join(',', $_POST&#1111;'your_array_names']);
basically..