#24823 [Opn->Csd]: wordwrap example clarification

From: Date: Sun, 27 Jul 2003 11:17:16 +0000
Subject: #24823 [Opn->Csd]: wordwrap example clarification
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969355481@lists.php.net to get a copy of this message
ID: 24823 Updated by: betz@php.net Reported By: curt at czirzow dot dyndns dot org -Status: Open +Status: Closed Bug Type: Documentation problem PHP Version: Irrelevant New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-07-26 19:06:07] curt at czirzow dot dyndns dot org Description: ------------ function wordwrap: ---- Example 1: $text = "The quick brown fox jumped over the lazy dog."; $newtext = wordwrap( $text, 20 ); echo "$newtext\n"; Example 1 output: The quick brown fox jumped over the lazy dog. --- This is rather misleading to new users, they seem to be expecting their output to be shown with carriage returns in html (since php defaults with text/html mime-type.) Perhaps using a <pre> tag around output: echo "<pre>$newtext</pre>" Or using the break parameter in the function: $newtext = wordwrap( $text, 20, '<br>'); This applies to both example 1 and 2. Thanks. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24823&edit=1

« previous php.doc (#969355481) next »