note 17617 deleted from function.split by zak
| From: | zak@php.net | Date: | Mon, 17 Dec 2001 19:27:14 +0000 |
| Subject: | note 17617 deleted from function.split by zak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22996@lists.php.net to get a copy of this message | ||
I needed a function that would split the text at a given length:
$cutlen = 150 //cut after $cutlen chars
$len = strlen($text); // get $text length
while($len > $cutlen) {
$array[] = substr($text,0,$cutlen);
$text = substr($text,$cutlen);
$len = strlen($text);
}
$array[] contains the lines after the text has been processed.
Maybe $text has to be handled afterwards tho