I wonder if there are any scripts that can wrap a double-byte and single-byte mixed character string into a user defined length?
I am also puzzled by this question. But I can not give another good answer execpt to deal from the begining of the string and deal with single byte one by one. If u have another good idea.pls tell me.TIA.
I saw this around somewhere..... Maybe it will help...
$screen_width = 80; echo preg_replace("/(.{".$screen_width."}\S*)/m","\1\n",$output_text);
Just replace the 80 with the character-limit for the line-break.
JbA
But how can I identify whether a character is a part of a double-byte character? Do you have any idea?
I tried this script, but only one line-break added, and position of the line-break is different from the screen-width specified!