# minWords

Checks if the number of words in the value equals or is above the given minimum

****

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

****

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

## Parameters

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

## Return type

`bool`

## In your code

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

## In fields

```yaml
fields:
  example:
    label: Example field
    type: text
    validate:
      minWords: 5
```