note 14913 added to function.chunk-split.php

From: Date: Tue, 21 Aug 2001 10:53:25 +0000
Subject: note 14913 added to function.chunk-split.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16947@lists.php.net to get a copy of this message
"\n" character (CR LF etc.) forces chunk_split to split string on this character. For example: I need to split a long string into chunks of 255 chars length. But I heed it to split a string by no more than 3 chunks. The string is "Sometext1 Sometext2\nSometext3". Whole string length has not exceeded 255 chars, but you get a result array of two elements: "Sometext1 Sometext2" and "Sometext3". Anyway in the case if given chunks limit is smaller than number of CRLF's in the source string, chunk_split() do it correctly, it don't split on first exceeding CRLFs. http://www.php.net/manual/en/function.chunk-split.php

« previous php.notes (#16947) next »