Add modifiers match, ematch, replace, ereplace, split, esplit, join with documentation [2]

This commit is contained in:
bzick
2014-07-10 23:28:27 +04:00
parent 702dbfd88d
commit 8e48d1aaee
7 changed files with 132 additions and 0 deletions

18
docs/mods/split.md Normal file
View File

@@ -0,0 +1,18 @@
Modifier split
==============
Split a string by string
```
{$string|split:$delimiter = ","}
```
Returns an array of strings, each of which is a substring of `$string` formed by splitting it on boundaries formed by the string `$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"]
```