![]() |
Implode on Debian does not work anymore! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Implode on Debian does not work anymore! (/showthread.php?tid=24047) |
Implode on Debian does not work anymore! - El Forum - 10-29-2009 [eluser]murphy2006[/eluser] Hello! I recently changed webserver OS from CentOS to Debian. I am now having problems with parts of my code. The implode function does not work anymore. It worked fine on CentOS and on my local PC (Windows). I got a webpage that contains alot of checkboxes so that users can make multiple choices and then the form is sent to a controller which implodes all the checkboxes into a comma seperated list of choosen items. View file The actual file contains many of the below form items (with different Values). Code: <input type="checkbox" class="checkbox" name="profile_marital[]" id="profile_marital[]" value="1" /> Controller file Code: implode(',', $this->input->post('profile_marital', TRUE)); I have also tried this but it failed too: Code: implode(',', $this->input->post('profile_marital[]', TRUE)); The error Code: A PHP Error was encountered Does anyone know what is wrong? The one thing I can think of is that CentOS used PHP 5.3 but Debian only 5.2.x Please help! Kind Regards, Daniel Implode on Debian does not work anymore! - El Forum - 10-29-2009 [eluser]@rno[/eluser] Hi Daniel, I don't know what's wrong with your implode function call, but thought there might be an easier whay to get the values of you checkboxes. Why nog giving your checkboxes a name like: profile_marital[1] profile_marital[2] etc. Once in your controller you could loop through the checkboxes as an array: Code: $items = $this->input->post('profile_marital'); Hope this helps. Regards, Arno |