note 75728 added to function.str-word-count
| From: | geertdd at gmail dot com | Date: | Wed, 13 Jun 2007 16:04:03 +0000 |
| Subject: | note 75728 added to function.str-word-count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127449@lists.php.net to get a copy of this message | ||
This is an update to my previously posted word_limiter() function. The regex is even more optimized
now. Just replace the preg_match line. Change to:
<?php
preg_match('/^\s*(?:\S+\s*){1,'. (int) $limit .'}/', $str, $matches);
----
Server IP: 87.238.162.147
Probable Submitter: 83.101.9.18
----
Manual Page -- http://www.php.net/manual/en/function.str-word-count.php
Edit -- https://master.php.net/note/edit/75728
Del: integrated -- https://master.php.net/note/delete/75728/integrated
Del: useless -- https://master.php.net/note/delete/75728/useless
Del: bad code -- https://master.php.net/note/delete/75728/bad+code
Del: spam -- https://master.php.net/note/delete/75728/spam
Del: non-english -- https://master.php.net/note/delete/75728/non-english
Del: in docs -- https://master.php.net/note/delete/75728/in+docs
Del: other reasons-- https://master.php.net/note/delete/75728
Reject -- https://master.php.net/note/reject/75728
Search -- https://master.php.net/manage/user-notes.php