Str::split()
Better alternative for explode() It takes care of removing empty values and it has a built-in way to skip values which are too short.
Str::split(array|string|null $string, non-empty-string $separator = ',', int $length = 1): array|list
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $string | arrayorstringornull |
no default value | |
| $separator | non-empty-string |
','
|
|
| $length | int |
1
|
The min length of values. |
Return types
arrayorlist<non-empty-string>