note 115214 added to function.wordwrap
| From: | phil_marmotte at yahoo dot fr | Date: | Fri, 13 Jun 2014 13:13:51 +0000 |
| Subject: | note 115214 added to function.wordwrap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199677@lists.php.net to get a copy of this message | ||
Another Word wrap from left or right :
public static function myWordWrap ($string, $length=3, $wrap=',', $from='left')
{
if ($from=='left') $txt=wordwrap($string, $length, $wrap, true);
if ($from=='right') {
$m = strlen($string)%$length;
if ($m < strlen($string))
$txt = substr($string,0,$m).$wrap.wordwrap(substr($string,$m),$length, $wrap, true);
else
$txt = $string;
}
return $txt;
}
----
Server IP: 72.52.91.14
Probable Submitter: 92.143.226.211
----
Manual Page -- http://php.net/manual/en/function.wordwrap.php
Edit -- https://master.php.net/note/edit/115214
Del: integrated -- https://master.php.net/note/delete/115214/integrated
Del: useless -- https://master.php.net/note/delete/115214/useless
Del: bad code -- https://master.php.net/note/delete/115214/bad+code
Del: spam -- https://master.php.net/note/delete/115214/spam
Del: non-english -- https://master.php.net/note/delete/115214/non-english
Del: in docs -- https://master.php.net/note/delete/115214/in+docs
Del: other reasons-- https://master.php.net/note/delete/115214
Reject -- https://master.php.net/note/reject/115214
Search -- https://master.php.net/manage/user-notes.php