Name

chunk_split

Synopsis

string chunk_split(string string[, int size[, string postfix]])

Inserts postfix into string every size characters and at the end of the string; returns the resulting string. If not specified, postfix defaults to \r\n and size defaults to 76. This function is most useful for encoding data to the RPF 2045 standard. For example:

$data = "...some long data...";
$converted = chunk_split(base64_encode($data));

Get Programming PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.