Skip to content

Kirby 5.0.4

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(string|array|null $string, string $separator = ',', int $length = 1): array

Parameters

Name Type Default Description
$string stringorarrayornull no default value The string to split
$separator string ',' The string to split by
$length int 1 The min length of values.

Return type

array

An array of found values

Parent class

Kirby\Toolkit\Str