note 40212 modified in function.str-word-count by aidan
| From: | aidan@php.net | Date: | Sat, 26 Jun 2004 06:16:35 +0000 |
| Subject: | note 40212 modified in function.str-word-count by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71718@lists.php.net to get a copy of this message | ||
This one reproduce the php 4.3.0 result... (skip the numbers)
<?php
function str_word_count($text){
$text=preg_replace("/[0-9]/"," ",$text);
$wordcount=count( preg_split("/[\W]+/", $text) );
return $wordcount;
}
?>
--was--
//just a little modification but....
//this one reproduce the php 4.3.0 result... (skip the numbers)
function str_word_count($text){
$text=preg_replace("/[0-9]/"," ",$text);
$wordcount=count( preg_split("/[\W]+/", $text) );
return $wordcount;
}
http://php.net/manual/en/function.str-word-count.php