From 6c9a370fc5084c2aa8ad16add6bb66d5f1bb8fcd Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Mon, 11 Sep 2000 20:23:00 +0000 Subject: [PATCH] - Updated extra function parameter to wordwrap. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@32511 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/strings.xml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) 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.