1. 程式人生 > >函數參數賦值的例子

函數參數賦值的例子

str ron php bsp money com content func har

代碼:

<HTML>
<HEAD><meta http-equiv="Content-Type" content="text/html;charset=gb2312"/>
</HEAD>
<BODY>
<?php
function totalmoney($jiage,$number)

{
$totallcost = $jiage*$number;

echo "您購買的價格為:$jiage"."元。" ,"數量為:$number"."本。<br/>";

echo "總共花費了:$totallcost"."元.";

}

totalmoney(20,3);

?>
</BODY>
</HTML>

結果:

技術分享

函數參數賦值的例子