Codice PHP:function textWrap ($text, $length, $break=" ") {
$pure=strip_tags($text);
$words=str_word_count($pure, 1);
foreach ($words as $word) {
if (strlen($word) > $length) {
$newword=wordwrap($word, $length, $break, TRUE);
$text=str_replace($word, $newword, $text);
}
}
return $text;
}
io ho trovato questa soluzione su php.net!
prova!
ciau!


Rispondi quotando