# minLength

Checks if the number of characters in the value equals or is greater than the given minimum

****

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

****

```php
V::minLength(string|null $value, $min): bool
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$value` | `string` or `null` | – | – |
| `$min` (required) | `mixed` | – | – |

## Return type

`bool`

This validator works like (sheet: validators/min) but it always checks for string length, even if a numeric value is given. The `min` validator will check for the value of the number in that case.

## In your code

```php
if (V::minLength('Lorem ipsum dolor sit amet.', 10)) {
  echo 'Yay, valid!';
}
```

## In fields

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