• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List

E:/E/GEAMP/www/openbiz/openbiz/others/Smarty/libs/plugins/modifier.count_words.php

00001 <?php
00020 function smarty_modifier_count_words($string)
00021 {
00022     // split text by ' ',\r,\n,\f,\t
00023     $split_array = preg_split('/\s+/',$string);
00024     // count matches that contain alphanumerics
00025     $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array);
00026 
00027     return count($word_count);
00028 }
00029 
00030 /* vim: set expandtab: */
00031 
00032 ?>

Generated on Thu Apr 19 2012 17:01:16 for openbiz by  doxygen 1.7.2