#29760 [Fbk->Bgs]: not correct works function, separators are placed accidentally
| From: | derick@php.net | Date: | Thu, 19 Aug 2004 14:42:18 +0000 |
| Subject: | #29760 [Fbk->Bgs]: not correct works function, separators are placed accidentally | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64946@lists.php.net to get a copy of this message | ||
ID: 29760
Updated by: derick@php.net
Reported By: sych at php dot com dot ua
-Status: Feedback
+Status: Bogus
Bug Type: Strings related
Operating System: win2000
PHP Version: 5.0.0
New Comment:
Ah, there was already a script.
The wordwrap function seperates on characters (second parameter), not
words.
Please read the documentation at http://php.net/wordwrap
Previous Comments:
------------------------------------------------------------------------
[2004-08-19 16:35:16] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2004-08-19 16:30:55] sych at php dot com dot ua
Code1:
$text = wordwrap($string, 2, "#");
Result1:
word1#word2#word3#word4#word5#word6#word7#word8"
Expected result1:
word1 word2# word3 word4# word5 word6# word7 word8
Code2:
$text = wordwrap($string, 3, "#");
Result2:
word1#word2#word3#word4#word5#word6#word7#word8"
Expected result2:
word1 word2 word3# word4 word5 word6# word7 word8
------------------------------------------------------------------------
[2004-08-19 16:22:56] tony2001@php.net
Err.. Forget it, clicked on a wrong link.
Please, provide more information, your example is not readable.
------------------------------------------------------------------------
[2004-08-19 16:21:00] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-08-19 16:19:30] sych at php dot com dot ua
Description:
------------
not correct works function, separators are placed accidentally,
Reproduce code:
---------------
$text = wordwrap($row['text'], $param['words'], "#");
Expected result:
----------------
ÐпÑеделение
ÑÑÑанÑ#пÑиÑедÑего
(PHP,#PostgreSQL) [p]ÐаÑем#нам ÑÑо#нÑжно[/p] Ð
ÑÑой#ÑÑаÑÑе
бÑдеÑ#ÑаÑÑмаÑÑиваÑÑÑÑ#ÑпоÑоб
опÑеделиÑÑ#ÑÑÑанÑ
пÑиÑедÑего#на ÐаÑ
ÑайÑ#полÑзоваÑелÑ.#ÐÑименÑÑÑ
ÑÑо
Actual result:
--------------
ÐпÑеделение ÑÑÑанÑ
пÑиÑедÑего (PHP,
PostgreSQL) [p]ÐаÑем нам ÑÑо нÑжно[/p] Ð
ÑÑой
ÑÑаÑÑе бÑдеÑ
ÑаÑÑмаÑÑиваÑÑÑÑ ÑпоÑоб
опÑеделиÑÑ ÑÑÑанÑ
пÑиÑедÑего на ÐаÑ
ÑайÑполÑзоваÑелÑ.
ÐÑименÑÑÑ ÑÑо #
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29760&edit=1