Creating an array from checked checkboxes

4 posts by 2 authors in: Forums > CMS Builder
Last Post: October 26, 2009   (RSS)

Re: [eduran582] Creating an array from checked checkboxes

By Dave - October 26, 2009

Hi Eric,

This isn't something we typically support... but try this:

//
$fields = array();
foreach ( $_POST['box'] as $fieldname ) {
$fields[] = $fieldname;
}


The [] on the end appends an element to the array and is the same as: array_push($fields, $fieldname)

Another option might be to print out flist directly since it's already in the CSV format you need.

Hope that helps! Let me know how it goes. :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Creating an array from checked checkboxes

Hi Dave,

First off, your solution worked great! Second, sorry for adding something to your already busy schedule. [unsure] I thought because it was within a cmsb program in php I could use the forum to ask for help. I had already been trying to find the solution for a couple of days now and was stumped. I truly do appreciate your help.

Thanks again for your great support.

Eric

Re: [eduran582] Creating an array from checked checkboxes

By Dave - October 26, 2009

Hi Eric,

Great, glad to hear that worked!

Yea, it's no problem and we're happy to help. Feel free to post when you're stumped on something. We'll help if we can, or we'll try and point you in the right direction. :)
Dave Edis - Senior Developer
interactivetools.com