Jason Wong wrote:
On Wednesday 17 November 2004 23:15, Merlin wrote:
actually that is not as easy as it looks.
Nowhere in your original post did you specify what exactly it is you wanted.
Lets say we want to ad a \n after each 80 characters. There is always the
problem what happens if the line has already a \n inside.
E.g:
This is a sample text. This is a sample text.
This is a sample text
Should result in:
> This is a sample text. This is a
> sample text.
> This is a sample text
That looks very complicated to me. Can anybody point me into the right
direction? Thanx for any help,
If it's only one level of '>' that you need to add then it's pretty easy using
the wordwrap() function. If you need to handle multiple levels then it will
get very complicated, and you should probably google for some algorithms.
Now that was an excellent hint! Thank you.
Here is how the problem got solved:
$message = "\n> ".wordwrap($row->message, 70, "\n> ");
http://de2.php.net/wordwrap
Thank you Jason!
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php