<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>count_paragraphs</title> <meta name="generator" content="DocBook XSL Stylesheets V1.75.1"> <link rel="home" href="index.html" title="Smarty Manual"> <link rel="up" href="language.modifiers.html" title="Chapter 5. Variable Modifiers"> <link rel="prev" href="language.modifier.count.characters.html" title="count_characters"> <link rel="next" href="language.modifier.count.sentences.html" title="count_sentences"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr><th colspan="3" align="center">count_paragraphs</th></tr> <tr> <td width="20%" align="left"> <a accesskey="p" href="language.modifier.count.characters.html">Prev</a> </td> <th width="60%" align="center">Chapter 5. Variable Modifiers</th> <td width="20%" align="right"> <a accesskey="n" href="language.modifier.count.sentences.html">Next</a> </td> </tr> </table> <hr> </div> <div class="sect1" title="count_paragraphs"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="language.modifier.count.paragraphs"></a>count_paragraphs</h2></div></div></div> <p> This is used to count the number of paragraphs in a variable. </p> <div class="example"> <a name="id3033622"></a><p class="title"><b>Example 5.5. count_paragraphs</b></p> <div class="example-contents"> <pre class="programlisting"> <?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." ); ?> </pre> <p> Where template is: </p> <pre class="programlisting"> {$articleTitle} {$articleTitle|count_paragraphs} </pre> <p> Will output: </p> <pre class="screen"> War Dims Hope for Peace. Child's Death Ruins Couple's Holiday. Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation. 2 </pre> </div> </div> <br class="example-break"><p> See also <a class="link" href="language.modifier.count.characters.html" title="count_characters"><code class="varname">count_characters</code></a>, <a class="link" href="language.modifier.count.sentences.html" title="count_sentences"><code class="varname">count_sentences</code></a> and <a class="link" href="language.modifier.count.words.html" title="count_words"><code class="varname">count_words</code></a>. </p> </div> <div class="navfooter"> <hr> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"> <a accesskey="p" href="language.modifier.count.characters.html">Prev</a> </td> <td width="20%" align="center"><a accesskey="u" href="language.modifiers.html">Up</a></td> <td width="40%" align="right"> <a accesskey="n" href="language.modifier.count.sentences.html">Next</a> </td> </tr> <tr> <td width="40%" align="left" valign="top">count_characters </td> <td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td> <td width="40%" align="right" valign="top"> count_sentences</td> </tr> </table> </div> </body> </html>