欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

smarty模板數(shù)學(xué)運(yùn)算示例

 更新時間:2016年12月11日 10:57:36   作者:牛逼的霍嘯林  
這篇文章主要介紹了smarty模板數(shù)學(xué)運(yùn)算用法,結(jié)合實(shí)例形式分析了Smarty模板實(shí)現(xiàn)基本數(shù)學(xué)運(yùn)算的操作技巧,需要的朋友可以參考下

本文實(shí)例講述了smarty模板數(shù)學(xué)運(yùn)算用法。分享給大家供大家參考,具體如下:

{* $height=4, $width=5 *}
{math equation="x + y" x=$height y=$width}

輸出:

9

{* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
{math equation="height * width / division"
   height=$row_height
   width=$row_width
   division=#col_div#}

輸出:

100

{* you can use parenthesis *}
{math equation="(( x + y ) / z )" x=2 y=10 z=2}

輸出:

6

{* you can supply a format parameter in sprintf format *}
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}

輸出:

9.44

通過他們可以完成一些數(shù)學(xué)運(yùn)算!

更多關(guān)于Smarty相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《smarty模板入門基礎(chǔ)教程》、《PHP模板技術(shù)總結(jié)》、《PHP基于pdo操作數(shù)據(jù)庫技巧總結(jié)》、《PHP運(yùn)算與運(yùn)算符用法總結(jié)》、《PHP網(wǎng)絡(luò)編程技巧總結(jié)》、《PHP基本語法入門教程》、《php面向?qū)ο蟪绦蛟O(shè)計入門教程》、《php字符串(string)用法總結(jié)》、《php+mysql數(shù)據(jù)庫操作入門教程》及《php常見數(shù)據(jù)庫操作技巧匯總

希望本文所述對大家基于smarty模板的PHP程序設(shè)計有所幫助。

相關(guān)文章

最新評論