# integer

Checks for a valid integer

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/src/Toolkit/V.php#L433>

****

```php
V::integer($value, bool $strict = false): bool
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$value` (required) | `mixed` | – | – |
| `$strict` | `bool` | `false` | – |

## Return type

`bool`

## In your code

```php
if (V::integer(12)) {
  echo 'Yay, valid!';
}
```

## In fields

```yaml
fields:
  example:
    label: Example field
    type: text
    validate: integer
```