 Parent Directory
|
 Parent Directory
|  Revision Log
 Revision Log
no message
| 1 | cvsjoko | 1.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 | ?> | 
| MailToCvsAdmin">MailToCvsAdmin | ViewVC Help | 
| Powered by ViewVC 1.1.26 |  |