fenom/docs/ru/mods/split.md
2014-08-06 21:36:11 +04:00

18 lines
545 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Модификатор split
==============
Разбивает строку с помощью разделителя
```
{$string|split:$delimiter = ","}
```
Возвращает массив строк, полученных разбиением строки с использованием `$delimiter` в качестве разделителя.
```smarty
{var $fruits1 = "banana,apple,pear"|split}
$fruits1 is array ["banana", "apple", "pear"]
{var $fruits2 = "banana,apple,pear"|split:',apple,'}
$fruits2 is array ["banana", "pear"]
```