php - Differences between filter_var and filter_input -


why doesn't work:

if(!($data['email'] = filter_var(input_post,'email',filter_sanitize_email))) {     $errors['email'] = 'invalid email.'; } 

and working:

if(!($data['email'] = filter_input(input_post,'email',filter_sanitize_email))) {     $errors['email'] = 'invalid email.'; } 

difference here filter_var , filter_input , when hit submit whit filter_var doesn't submitting form filter_input submitted. here

filter_input(input_post,'email',filter_sanitize_email)) 

if wrote example some'@email.com why doesn't remove '. working function? i'm bit confused.

if @ arguments filter_var , filter_input functions take, see why:

filter_var ($value_to_be_filtered, filter_type, $options) 

vs

filter_input($input_type , $variable_from_input, filter_type, $options) 

where $input_type 1 of input_get, input_post, input_cookie, input_server, or input_env.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -