[ Index ]

krapohl.info

title

Body

[close]

/pnincludes/Smarty/plugins/ -> modifier.count_paragraphs.php (source)

   1  <?php
   2  
   3  /*
   4   * Smarty plugin
   5   * -------------------------------------------------------------
   6   * Type:     modifier
   7   * Name:     count_paragraphs
   8   * Purpose:  count the number of paragraphs in a text
   9   * -------------------------------------------------------------
  10   */
  11  function smarty_modifier_count_paragraphs($string)
  12  {
  13      // count \r or \n characters
  14      return count(preg_split('/[\r\n]+/', $string));
  15  }
  16  
  17  /* vim: set expandtab: */
  18  
  19  ?>


Generated: Wed Feb 16 22:40:07 2005 Cross-referenced by PHPXref 0.6