Bug #13362 Updated: function wordwrap bug
| From: | jimw@php.net | Date: | Fri, 04 Jan 2002 19:40:38 +0000 |
| Subject: | Bug #13362 Updated: function wordwrap bug | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-75898@lists.php.net to get a copy of this message | ||
ID: 13362
Updated by: jimw
Reported By: herveseignole@yahoo.fr
Old Status: Analyzed
Status: Closed
Bug Type: Strings related
Operating System: Linux Mandrake 8.0
PHP Version: 4.0.4pl1
New Comment:
this current behavior is correct. wordwrap() will only cut a word when
it is, by itself, longer than the line length. whenever it can cut the
line between words, it does.
it is easier to see what is going on using:
<?
$text="A very long woooooooooooord.";
echo wordwrap($text, 8, "|", 1);
which prints:
A very|long|wooooooo|ooooord.
Previous Comments:
------------------------------------------------------------------------
[2001-10-21 05:06:16] derick@php.net
4.2.0dev shows:
A very long woooooooooooor d.
------------------------------------------------------------------------
[2001-10-20 22:25:30] sniper@php.net
Reproduced with PHP 4.1.0RC1
------------------------------------------------------------------------
[2001-09-18 07:33:45] herveseignole@yahoo.fr
<?
$text="A very long woooooooooooord.";
$newtext=wordwrap($text,8," ",1);
echo "$newtext\n";
?>
return:
A very long woooooooooooo rd.
not
A very long wooooooo ooooord.
php 4.0.4pl1
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13362&edit=1