CodeIgniter Forums
Checkbox Values - 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: Checkbox Values (/showthread.php?tid=34404)

Pages: 1 2


Checkbox Values - El Forum - 10-02-2010

[eluser]pkrstic[/eluser]
Try this way:
[code]
'oe_related' => $this->input->post('oe_related') == 'Y' : 'Y' ? 'N',
[code]

Also in my project n/y is always represented as int 0/1, MUCH easier to work with that in php, since there is no need to translate Y to true and N to false.