← All docs

chunk_split()

Splits a string into fixed-length chunks separated by a given string.

chunk_split()

function chunk_split(string $string, int $length = 76, string $separator = '\r\n'): string

Splits a string into fixed-length chunks separated by a given string.

Parameters:

  • $string (string)
  • $length (int), default 76, optional
  • $separator (string), default '\r\n', optional

Returns: string

Availability

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

Internals

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