Filter a variable with the specified filter in PHP
Description
The following code shows how to filter a variable with the specified filter.
Example
/*from w w w . j a va 2 s . c om*/
<?php
if(!filter_var("someone@example....com", FILTER_VALIDATE_EMAIL)){
echo("E-mail is not valid");
}else{
echo("E-mail is valid");
}
?>
The code above generates the following result.