PHP Resources
Home
Books
Directories
Magazines
Non-English Sites
Online Communities
Tools
Tutorials and Articles
Web Hosting
PHP Functions
PHP News Groups *
PHP Reference
Smarty Reference
Pear Reference
PHP-GTK Reference

By submitting PHP Resources you own, or know of, you'll help us build the largest PHP Resource website on the net. Please double check that your resource doesn't already exist before you submit it!!. We thank you for helping make this a better website.









Resource Image Newest ResourcesPopular ResourcesTop Resources Resource Image
PHP Resources
count_paragraphs

count_paragraphs

This is used to count the number of paragraphs in a variable.

Example 5-5. count_paragraphs

<?php

$smarty
->assign('articleTitle',
                 
"War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.\n\n
                 Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation."
                
);

?>

Where template is:

{$articleTitle}
{$articleTitle|count_paragraphs}

Will output:

War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.

Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
2

See also count_characters, count_sentences and count_words.





Featured




Featured
PHP Code Examples
web site templates
Learn PHP playing Trivia
PHP & MySQL Forums
Web Development Index

List Your ResourceUpdate Your Resource

Copyright © 2006 - 2008 MickMel Inc