note 57090 added to function.wordwrap

From: Date: Fri, 23 Sep 2005 10:26:42 +0000
Subject: note 57090 added to function.wordwrap
Groups: php.notes 
Request: Send a blank email to php-notes+get-95652@lists.php.net to get a copy of this message
utf8_wordwrap(); usage: utf8_wordwrap("text",3,"<br>"); coded by tjomi4`, thanks to SiMM. web: www.yeap.lv <?php function utf8_wordwrap($str,$len,$what){ # usage: utf8_wordwrap("text",3,"<br>"); # by tjomi4`, thanks to SiMM. # www.yeap.lv $from=0; $str_length = preg_match_all('/[\x00-\x7F\xC0-\xFD]/', $str, $var_empty); $while_what = $str_length / $len; while($i <= round($while_what)){ $string = preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$from.'}'. '((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*#s', '$1',$str); $total .= $string.$what; $from = $from+$len; $i++; } return $total; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.wordwrap.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57090 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57090&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57090&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57090&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57090&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57090&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57090&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57090&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57090&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95652) next »