diff --git a/functions/strings.xml b/functions/strings.xml index d8f1b65f3b..1bd8afb17b 100644 --- a/functions/strings.xml +++ b/functions/strings.xml @@ -2944,6 +2944,9 @@ $text = ucwords($text); // $text is now: Mary Had A Little string break + int + cut + @@ -2957,6 +2960,12 @@ $text = ucwords($text); // $text is now: Mary Had A Little 75 and break using '\n' (newline) if width or break are not given. + + If the cut is set to 1, the string is + always wrapped at the specified width. So if you have a word + that is larger than the given width, it is broken appart. + (See second example). + <function>wordwrap</function> example @@ -2975,7 +2984,31 @@ echo "$newtext\n"; The quick brown fox - jumped over the lazy dog. +jumped over the lazy dog. + + + + + + <function>wordwrap</function> example + +$text = "A very long woooooooooooord."; +$newtext = wordwrap( $text, 8, "\n", 1); + +echo "$newtext\n"; + + + + + This example would display: + + + + +A very +long +wooooooo +ooooord.