# max

Checks if the value does not exceed the maximum value

****

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

****

```php
V::max($value, float $max): bool
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$value` (required) | `mixed` | – | – |
| `$max` (required) | `float` | – | – |

## Return type

`bool`

## In your code

```php
if (V::max(5, 10)) {
  echo 'Yay, valid!';
}
```

## In fields

```yaml
fields:
  example:
    label: Example field
    type: text
    validate:
      max: 10
```