# In Array

Check if an array contains a specific value. Returns `true` if a match is found.

The first parameter is the "needle" to find in the "haystack". It will read from the context if there is a matching variable, otherwise it will use the parameter as the value. You can pass multiple arguments.

```yaml
shopping_list:
  - eggs
  - flour
  - beef jerky
want: eggs
```

::tabs

::tab antlers
```antlers
{{ if (shopping_list | in_array('flour')) }} GOT IT! {{ /if }}
{{ if (shopping_list | in_array('want')) }} GOT EM! {{ /if }}
{{ if (shopping_list | in_array('eggs', 'flour')) }} YES I DID NOT FORGET! {{ /if }}
```
::tab blade
```blade
@if (Statamic::modify($shopping_list)->inArray('flour')->fetch()) GOT IT! @endif
@if (Statamic::modify($shopping_list)->inArray('want')->fetch()) GOT EM! @endif
@if (Statamic::modify($shopping_list)->inArray('eggs', 'flour')->fetch()) YES I DID NOT FORGET! @endif
```
::


```html
GOT IT!
GOT EM!
YES I DID NOT FORGET!
```
