wordwrapping
Posted: Fri Nov 25, 2005 10:20 am
Wordwrap doesn't work if there is a very long string with no spaces in it. Thus, the wordwrap function becomes ineffective. How can I fix this so it will break a long string anyways?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$text = "A very long woooooooooooord.";
$newtext = wordwrap($text, 8, "\n", 1);
echo "$newtext\n";
?>Code: Select all
A very
long
wooooooo
ooooord.