I hope somebody with better problem solving skills can help me out here. I have a textarea and all I had to do is split the text into 50 chars and feed the lines to another app. No problem. But I forgot about \n line breaks. If someone puts linebreak I have to also make that a seperate line. Here's my current code ($content is the original text). I'm sure there is an easy way I just can't get to it.
$div = strlen($content) / 50;
$x=0;
while ($x<$div) {
$substr=$x*50;
$text = substr($content,$substr,50);
if (trim($text)!="") {
echo $text . "<br>";
}
$x++;
}