# in_array

test if value is contained in an array

## Basic usage

```smarty
{if in_array('value2', $myarray)} value2 is in myarray{/if}
```

Can be replaced by operator *is in*

```smarty
{if 'value2' is in $myarray}value2 is in myarray{/if}
```

See Also [operators](../language-basic-syntax/language-syntax-operators.md)
