Linux Tutorials | cPanel Tutorials | Remote System Administration
count_paragraphs

count_paragraphs

Este es usado para contar el número de parrafos en la variable.

Ejemplo 5-5. count_paragraphs

<?php
$smarty
= new Smarty;
$smarty->assign('articleTitle', "War Dims Hope for Peace. Child's Death Ruins
Couple's Holiday.\n\nMan is Fatally Slain. Death Causes Loneliness, Feeling of Isolation."
);
$smarty->display('index.tpl');
?>

Donde index.tpl es:

{$articleTitle}
{$articleTitle|count_paragraphs}

Esta es la Salida:

War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.
     
Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
2