note 40426 deleted from function.wordwrap by nlopess
| From: | nlopess@php.net | Date: | Wed, 03 Mar 2004 17:42:04 +0000 |
| Subject: | note 40426 deleted from function.wordwrap by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66190@lists.php.net to get a copy of this message | ||
Note Submitter: grey at greywyvern dot com
----
Response to the wordwrap2 function posted by desolate19 at hotmail dot com...
The function works great, but if you're designing scripts for maximum portability between PHP
versions, keep in mind that the function ctype_space is only enabled by default after PHP 4.2.0.
I had to change the ctype_space($chr) to preg_match("/\s/", $chr) in order to fix it for
some users on other machines. This, of course, is slower, but I wasn't wrapping 1,000s of
lines in the script I was building anyway.