Ik heb deze functie herschreven omdat de vorige het niet echt goed deed, oftewel vast liep: eerst liep deze goed maar nu opeens niet meer 
wie kan me helpen deze te fixen, want komt nu volgens mij in een 'endless' loop.
PHP:
1
| <?function warp_text($text) { // convert lange woorden! :) $t_lines = split( "\n", $text); while(list(, $thisline) = each($t_lines)) { if(strlen($thisline) > 25) { // cols $newline = ""; $t_l_lines = split(" ", $thisline); while(list(, $thisword) = each($t_l_lines)) { while((strlen($thisword) + strlen($prefix)) > 25) { $cur_pos = 0; $outlines .= $prefix; for($num = 0; $num < $cols - 1; $num++) { $outlines .= $thisword[$num]; $cur_pos++; } $outlines .= " "; /* \n */ $thisword = substr($thisword, $cur_pos, (strlen($thisword) - $cur_pos)); } if((strlen($newline) + strlen($thisword)) > 25) { $outlines .= $newline . " "; /* \n */ $newline = $thisword . " "; }else{ $newline .= $thisword . " "; } } $outlines .= $newline . "\n"; }else{ $outlines .= $thisline . "\n"; } } return $text;}?> |