Using explode, it's possible to convert a string into a list based on one or more characters.
Examples
In the example below, we have the text "1|dollar" and we want to split it into individual parts based on the pipe character:
Using explode, it's possible to convert a string into a list based on one or more characters.
explode
{{","|explode:$text}}
In the example below, we have the text "1|dollar" and we want to split it into individual parts based on the pipe character:
explode
{{$someVar ="|"|explode:"1|dollar"}}
<pre>{{$someVar|print_r}}</pre>
Output:
Array
(
[0] => 1
[1] => dollar
)