Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

count_sentences

Isto é usado para contar o número de sentenças em uma variável.

Example 5.6. count_sentences

index.php:

$smarty = new Smarty;
$smarty->assign('articleTitle', 'Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.');
$smarty->display('index.tpl');

index.tpl:

{$articleTitle}
{$articleTitle|count_sentences}

MOSTRA:

Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
2

Comments
No comments for this page.

Advertisement