Comunitatea PHP Romania
 

 
nl2br

nl2br

All "\n" line breaks will be converted to html <br /> tags in the given variable. This is equivalent to the PHP's nl2br() function.

Example 5-14. nl2br

<?php

$smarty
->assign('articleTitle',
                
"Sun or rain expected\ntoday, dark tonight"
                
);

?>

Where the template is:

{$articleTitle|nl2br}

Will output:

Sun or rain expected<br />today, dark tonight

See also word_wrap, count_paragraphs and count_sentences.

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
acasa , in pat
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
Mascka Mascka
Braila
raul_ raul_
whooper whooper
Toronto ON
mihaitha mihaitha
Sibiu
gabysolomon gabysolomon
Bacau
oriceon oriceon
Constanta
garlicinicolae garlicinicolae

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Flights | Dutch Bodybuilding Forums | Social networking | Loans | Mortgages
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis