Split a string into an array, using PHP's explode function.
- Service:
CleverAge\ProcessBundle\Transformer\String\ExplodeTransformer - Transformer code:
explode
Any value that can be cast to string, or null.
array: the list of parts; an empty array if the input is null or an empty string
| Code | Type | Required | Default | Description |
|---|---|---|---|---|
delimiter |
string |
X | The boundary string, must not be empty |
'a,b,c'becomes['a', 'b', 'c']
# Transformer options level
explode:
delimiter: ','- Split then trim each part:
'a, b ,c'becomes['a', 'b', 'c']
# Transformer mapping level
tags:
code: '[tags]'
transformers:
explode:
delimiter: ','
array_map:
transformers:
trim: ~