0
<input type="text" name="ip[]"/>
<?php
$ip = $_POST['ip'];
if(filter_var($ip, FILTER_VALIDATE_IP)) {
echo("$ip is a valid IP address");
}else {
echo("$ip is not a valid IP address");
}
?>
If I put any ip without being array inside the variable that receives my ip and validates it quietly, but when I pass an array, since the input field is dynamic, php does not accept validation.
I even tried to use FILTER_REQUIRE_ARRAY, but it didn’t work.
It worked out here, vlwsss
– Caio Frias
You need to scream ;-)
– Rodrigo Teixeira Andreotti