← All docs

str_split()

Converts a string into an array of chunks of the given length.

str_split()

function str_split(string $string, int $length = 1): array

Converts a string into an array of chunks of the given length.

Parameters:

  • $string (string)
  • $length (int), default 1, optional

Returns: array

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how str_split is implemented in the compiler, see the internals page.