filter var 28 29

Solutions on MaxInterview for filter var 28 29 by the best coders in the world

showing results for - "filter var 28 29"
Elias
20 Oct 2018
1var_dump(filter_var('bob@example.com', FILTER_VALIDATE_EMAIL));
2var_dump(filter_var('http://example.com', FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED));
3
Eleonora
10 Mar 2016
1
2 <?php
3$ip = "2001:0db8:85a3:08d3:1319:8a2e:0370:7334";
4
5if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
6  echo("$ip is a valid IPv6 address");
7} else {
8
9    echo("$ip is not a valid IPv6 address");
10}
11?>
12 
Felix
29 Jun 2019
1
2 <?php
3$int = 122;
4$min = 1;
5$max = 200;
6
7if (filter_var($int, FILTER_VALIDATE_INT, array("options" => array("min_range"=>$min, "max_range"=>$max))) === false) {
8  echo("Variable value is not within the legal range");
9} else {
10  echo("Variable value is within the legal range");
11}
12?>
13