Get Smarty

Donate

Donate Bitcoin Bitcoin
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

Buy cheap eyeglasses from Cheapglasses123.com and save up to 80%.

Buy prescription glasses from www.australiaglasses.com and save.

Cheap Glasses Now On Sale at GlassesPeople.com. Starts At $7.95.

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Brautkleider auf Topwedding.de

Find free files to download on allwhatyouwant.net

Looking For Affordable Wedding Dresses 2015 at Best Prices On TDBridal.com

Shop high quality cheap prom dresses on Dresswe.co.uk

Buy New Arrival Cheap Prom Dresses 2015 at JDBRIDAL Prom Dress Store

Advertisement

wordwrap

闄愬埗涓琛屽瓧绗︾殑闀垮害锛堣嚜鍔ㄦ崲琛岋級锛岄粯璁ゆ槸80涓瓧绗﹂暱搴︺ 鍙夌殑绗簩涓弬鏁帮紝鍙嚜瀹氫箟鎹㈣瀛楃锛岄粯璁ゆ崲琛屽瓧绗︽槸 "\n"銆 榛樿鎯呭喌涓嬶紝鏄牴鎹崟璇嶆潵鎹㈣鐨勶紝涔熷氨鏄寜鑻辨枃璇硶鐨鑷姩鎹㈣銆 濡傛灉浣犲笇鏈涙寜鐓у瓧绗︽潵鎹㈣锛堣竟鐣岀殑鍗曡瘝灏嗘媶寮锛夛紝閭d箞鍙互璁剧疆 鍙夌殑绗笁涓弬鏁颁负TRUE锛屾晥鏋滀笌PHP鍑芥暟wordwrap()涓鏍枫

鍙傛暟椤哄簭 绫诲瀷 蹇呴夊弬鏁 榛樿鍊 璇存槑
1 integer No 80 闄愬畾涓琛岀殑闀垮害銆
2 string No \n 鎹㈣绗﹀彿
3 boolean No FALSE 璁剧疆鎸夊崟璇嶆崲琛(FALSE)锛屾垨鑰呮寜瀛楃鎹㈣(TRUE)銆

Example聽5.24.聽wordwrap


<?php

$smarty->assign('articleTitle',
                "Blind woman gets new kidney from dad she hasn't seen in years."
               );

?>

   

妯℃澘锛


{$articleTitle}

{$articleTitle|wordwrap:30}

{$articleTitle|wordwrap:20}

{$articleTitle|wordwrap:30:"<br />\n"}

{$articleTitle|wordwrap:26:"\n":true}

   

杈撳嚭:


Blind woman gets new kidney from dad she hasn't seen in years.

Blind woman gets new kidney
from dad she hasn't seen in
years.

Blind woman gets new
kidney from dad she
hasn't seen in
years.

Blind woman gets new kidney<br />
from dad she hasn't seen in<br />
years.

Blind woman gets new kidn
ey from dad she hasn't se
en in years.

   

鍙傝 nl2br{textformat}.

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 8 plus 5? (Are you human?)

Advertisement