XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
modifier.count_words.php
Go to the documentation of this file.
1
<?php
21
function
smarty_modifier_count_words
($string)
22
{
23
// split text by ' ',\r,\n,\f,\t
24
$split_array = preg_split(
'/\s+/'
,$string);
25
// count matches that contain alphanumerics
26
$word_count = preg_grep(
'/[a-zA-Z0-9\\x80-\\xff]/'
, $split_array);
27
28
return
count($word_count);
29
}
30
31
/* vim: set expandtab: */
32
33
?>
L:
0xoops
xoops-2.5.6
htdocs
class
smarty
plugins
modifier.count_words.php
Generated on Fri May 10 2013 01:04:24 for XOOPS 2.5.6 by
1.8.3.1