#24823 [NEW]: wordwrap example clarification
| From: | curt at czirzow dot dyndns dot org | Date: | Sun, 27 Jul 2003 00:06:07 +0000 |
| Subject: | #24823 [NEW]: wordwrap example clarification | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969355478@lists.php.net to get a copy of this message | ||
From: curt at czirzow dot dyndns dot org
Operating system:
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: wordwrap example clarification
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 bug report at http://bugs.php.net/?id=24823&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24823&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24823&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=24823&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24823&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24823&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24823&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24823&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24823&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24823&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24823&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24823&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24823&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24823&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24823&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24823&r=gnused