|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-03-01 05:52 UTC] mikael at whip3 dot net
The function wordwrap removes on space character if a break occurs between two words. This is not always desired behavior.
For example:
echo wordwrap('abc abc abc abc', 13, 'X', 1);
Note: 4 spaces between last pair
Results in:
abc abc abc X abc
Two spaces left before the break and one after. One space gets removed. The same happens if we only have one space where a line break occurres, leaving us with only a line break between the words.
/ mikael
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 19:00:01 2025 UTC |
This would accomplish what you want without using `wordwrap()`. echo join("X", str_split($str, 13));