is_int issue? - 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: is_int issue? (/showthread.php?tid=49514) |
is_int issue? - El Forum - 02-22-2012 [eluser]Unknown[/eluser] I have code: Code: else if($action == 'edit') Code: else if($action == 'edit') is_int issue? - El Forum - 02-22-2012 [eluser]CroNiX[/eluser] $this->uri->segment() returns a string, or boolean FALSE if the segment doesn't exist. So, it will never be an int unless you cast it like $gallery_id = (int)$gallery_id; If you do that though, it will never be boolean FALSE, it will be 0 in that case. Code: else if($action == 'edit') |