Replacing valid_email() with filter_var() |
According to this description the valid_email() function is deprecated and scheduled for removal in CodeIgniter 3.1+. The web page says that the PHP function filter_var() should be used instead.
But filter_var() takes two arguments, whereas valid_email() only takes one. So how do I specify a two-argument function with a fixed second argument in a form validation list? For example this example uses this code: Code: $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]'); How can I replace valid_email here with filter_var with FILTER_VALIDATE_EMAIL as the second argument? Or am I supposed to write my own valid_email() function? -- Claus |
Messages In This Thread |
Replacing valid_email() with filter_var() - by oz1cz - 05-03-2016, 02:02 AM
RE: Replacing valid_email() with filter_var() - by InsiteFX - 05-03-2016, 12:06 PM
RE: Replacing valid_email() with filter_var() - by drusnac19 - 10-15-2016, 05:47 PM
RE: Replacing valid_email() with filter_var() - by oz1cz - 05-03-2016, 01:38 PM
|