I have a string
$str = 'aaaaabbbbbcccccdddddeeeeefffffggggghhhhhjjjjj';
$pos = 0;
$tmp = 0;
while($pos<strlen($str)) {
$tmp .= substr($str,$pos,5)."\n";
$pos += 5;
}
I dont want to add a "\n" at the end of produced $str
aaaaa
bbbbb
ccccc
ddddd
eeeee
fffff
ggggg
hhhhh
jjjjj //No new line here
http://www.php.net/str-split
http://www.php.net/join