wordwrap confusion.

From: Date: Wed, 10 Oct 2001 00:04:25 +0000
Subject: wordwrap confusion.
Groups: php.dev 
Request: Send a blank email to php-dev+get-67648@lists.php.net to get a copy of this message
Ok. From the documentation for wordwrap(): Returns a string with str wrapped at the column number specified by the (optional) width parameter. The line is broken using the (optional) break parameter. The confusion lies with the phrase "column number" and the fact that width values of <= 0 are allowed. This is what I have noticed from a testing perspective: In all tests cut = 1 width == 0 : crash width == 1 : results in 2-character lines width == 2 : results in 2-character lines width > 2 : results in width-character lines I have a fix in hand for the case where width == 1, but I wanted to get a concensus among the interested parties. I plan to display a warning for width values <= 0 and default to 75 as 0 doesn't make much sense. Any objections/observations? Thanks, -- =================================================================== Sean Bright elixer@erols.com / sean@seanbright.com / http://www.seanbright.com/ ===================================================================

« previous php.dev (#67648) next »