note 98699 added to function.wordwrap
| From: | vituko at gmail dot com | Date: | Thu, 01 Jul 2010 12:58:47 +0000 |
| Subject: | note 98699 added to function.wordwrap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170620@lists.php.net to get a copy of this message | ||
Well, last try, I hope.
Now I realized that it didn't worked for short strings :
function mb_wordwrap ($cadea, $lonx=75, $sep="\n", $cortar_palabra=false) {
if (!$cortar_palabra)
return substr (preg_replace
('#(([\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){1,'.$lonx.'})(?: |$)+#',
'\1'.$sep, $cadea), 0, -mb_strlen ($sep)) ;
else
return substr (preg_replace
('#(?:((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){1,'.$lonx.'})(?:
|$)+|((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$lonx.'}))#', '\1\2'.$sep,
$cadea), 0, -mb_strlen ($sep)) ;
}
----
Server IP: 69.147.83.197
Probable Submitter: 95.18.181.79
----
Manual Page -- http://www.php.net/manual/en/function.wordwrap.php
Edit -- https://master.php.net/note/edit/98699
Del: integrated -- https://master.php.net/note/delete/98699/integrated
Del: useless -- https://master.php.net/note/delete/98699/useless
Del: bad code -- https://master.php.net/note/delete/98699/bad+code
Del: spam -- https://master.php.net/note/delete/98699/spam
Del: non-english -- https://master.php.net/note/delete/98699/non-english
Del: in docs -- https://master.php.net/note/delete/98699/in+docs
Del: other reasons-- https://master.php.net/note/delete/98699
Reject -- https://master.php.net/note/reject/98699
Search -- https://master.php.net/manage/user-notes.php