mirror of
https://github.com/Respect/Validation.git
synced 2026-03-18 08:09:51 +01:00
Some codes in the documentation were not code that actually works which can lead to some confusion of how to use Validation. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
633 B
633 B
Ip
Ip()Ip(mixed $options)
Validates IP Addresses. This validator uses the native filter_var() PHP function.
v::ip()->validate('127.0.0.1'); // true
v::ip('220.78.168.0/21')->validate('220.78.173.2'); // true
v::ip('220.78.168.0/21')->validate('220.78.176.2'); // false
You can pass a parameter with filter_var flags for IP.
v::ip(FILTER_FLAG_NO_PRIV_RANGE)->validate('192.168.0.1'); // false
Changelog
| Version | Description |
|---|---|
| 0.5.0 | Implemented IP range validatio |
| 0.3.9 | Created |
See also: