Skip to content

Kirby 5.0.4

ip

Checks for a valid IP address

V::ip($value): bool

Parameters

Name Type Default
$valuerequired mixed no default value

Return type

bool

In your code

if (V::ip('127.0.0.1')) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate: ip