Menu Home

chunk_split

osbo.com | PHP | Functions | chunk_split

Split a string into smaller chunks

Syntax

chunk_split ( string $body [, int $chunklen = 76 [, string $end = "\r\n" ]] ) : string

Parameters

body

The string to be chunked.

chunklen

The chunk length.

end

The line ending sequence.

Return

Returns the chunked string.

Examples

body

12345

chunklen

12
34
5

end

12,34,5,

base64_encode

ZW5jb2RlZCBzdHJpbmc=

PHP