mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-18 08:29:22 +01:00
18 lines
325 B
Markdown
18 lines
325 B
Markdown
# 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)
|