Top "Filter-var" questions

This is a PHP function to filter variables based on various filter flags.

PHP FILTER_VALIDATE_EMAIL does not work correctly

I'm using PHP 5.3.10. This is the code: <?php $email = "[email protected]"; if (filter_var($email, FILTER_VALIDATE_EMAIL)) …

php email-validation filter-var
Editing form to sanitize/validate phone number

I have very limited experience with PHP and I'm really hoping someone can help me. What I want to do …

php forms email filter-var
filter_var using FILTER_VALIDATE_REGEXP

I'm practicing my beginner php skills and would like to know why this script always returns FALSE? What am i …

php filter-var
Sanitize JSON with php

I always use filter_var($var, FILTER, FLAG); when I get data from $_GET, $_POST and so on, but now …

php json filter-var
PHP filter_var() - FILTER_VALIDATE_URL

The FILTER_VALIDATE_URL filter seems to have some trouble validating non-ASCII URLs: var_dump(filter_var('http://pt.wikipedia.…

php validation utf-8 filter filter-var
filter_var vs htmlentities vs htmlspecialchars

Disclaimer This is not a question about whether we should be escaping for database input. This is strictly looking at …

php escaping html-entities htmlspecialchars filter-var
PHP validation booleans using filter_var

I'm using filter_var to validate boolean values but I did not expect it to not recognize FALSE. Why does …

php validation boolean filter-var
The input value of false for FILTER_VALIDATE_BOOLEAN

I want the input to accpet 'true' or 'false' only, so I am trying to use FILTER_VALIDATE_BOOLEAN to …

php boolean filter-var