Validation Rules for Email CodeIgniter version 3.17

I am used to CodeIgniter .

I just started to working in CodeIgniter 3.17, and reached to validation rules.

I notice that xss_clean is now gone from the validation class, so what rules should I use in the validation of email ?

$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');

For More Visit Codeigniter website :

https://www.codeigniter.com/userguide3/libraries/form_validation.html

Please follow and like us:
0

Check if directory path ends with DIRECTORY_SEPARATOR

Check if directory path ends with DIRECTORY_SEPARATOR

In PHP I’m receiving a string from the user for a local file directory Path

I want to know if they’ve included the trailing slash (/) or not.

I would like this to be cross platform so I’d like to use the PHP constant DIRECTORY_SEPARATOR

preg_match("/" . preg_quote(DIRECTORY_SEPARATOR) . "$/", $path);

or

rtrim($path,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;

 

Please follow and like us:
0