prova ad usare questa
codice:function wordwrap2($str, $cols, $cut) { $wordlen = 0; $result = ""; $len = strlen($str); $tag = 0; for ($i = 0; $i < $len; $i++) { $chr = $str[$i]; if ($chr == '<') { $tag++; } else if ($chr == '>') { $tag--; } else if ((!$tag) && (ctype_space($chr))) { $wordlen = 0; } else if (!$tag) { $wordlen++; } if ((!$tag) && ($wordlen) && (!($wordlen % $cols))) { $chr .= $cut; } $result .= $chr; } return $result; }

Rispondi quotando