mirror of
https://github.com/Respect/Validation.git
synced 2024-06-08 16:52:16 +02:00
20 lines
334 B
PHP
20 lines
334 B
PHP
|
<?php
|
||
|
|
||
|
namespace Respect\Validation\Rules;
|
||
|
|
||
|
class Ip extends AbstractRule
|
||
|
{
|
||
|
|
||
|
public function __construct($options=null)
|
||
|
{
|
||
|
$this->options = $options;
|
||
|
}
|
||
|
|
||
|
public function validate($input)
|
||
|
{
|
||
|
return filter_var(
|
||
|
$input, FILTER_VALIDATE_IP, array('flags' => $this->options)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
}
|