Prevent null values on input post - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: Prevent null values on input post (/showthread.php?tid=69039) |
Prevent null values on input post - jonathanq - 09-29-2017 Just extends Input Core PHP Code: <?php RE: Prevent null values on input post - ciadmin - 09-29-2017 Moved your post here, as it appears to be a suggestion rather than a bug or support request. RE: Prevent null values on input post - Paradinight - 09-29-2017 (09-29-2017, 10:10 AM)jonathanq Wrote: Just extends Input Core Why? If you need an empty string use (string) before the methode. $data = (string) $this->input->post('not_exist'); RE: Prevent null values on input post - dave friend - 09-29-2017 But what if an empty string is not wanted but NULL is? If we want to make everyone happy then maybe something like this PHP Code: /** |