Login +

Documentation

SLS_String::countWords

Since SillySmart 1.0

Description

Count the number of words in a string
static int countWords ( string $string, [ bool $real_words ] );

Parameters

  • string $string
    the string to count
  • bool $real_words
    true if you want to omit special chars

Return

int
the number of words

Exemples

  •  var_dump(SLS_String::countWords("SillySmart is a lightweight and flexible MVC Framework written in PHP5, based on XML/XSL's parsing."));
     // will produce : 15

Comments

No comment on this function, be the first !

Add your comment

You must login/register to post a reply.