Multi-byte safe wordwrap() function for UTF-8
I haven’t found any working code for me. Here is what I’ve written. For me it is working, thought it is probably not the fastest. function mb_wordwrap($str, $width = 75, $break = “\n”, $cut = false) { $lines = explode($break, $str); foreach ($lines as &$line) { $line = rtrim($line); if (mb_strlen($line) <= $width) continue; $words … Read more