O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

chunk_split

Synopsis

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

Inserts postfix into string after 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));

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required