![]() |
Documentación GVHIDRA 3.1.5
|
Ir al código fuente de este archivo.
Namespaces | |
namespace | Smarty |
Funciones | |
smarty_modifier_count_words ($string) |
smarty_modifier_count_words | ( | $ | string | ) |
Smarty count_words modifier plugin
Type: modifier
Name: count_words
Purpose: count the number of words in a text count_words (Smarty online manual) Monte Ohrt
string |
Definición en la línea 21 del archivo modifier.count_words.php.
{ // split text by ' ',\r,\n,\f,\t $split_array = preg_split('/\s+/',$string); // count matches that contain alphanumerics $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array); return count($word_count); }