下一篇 » « 上一篇

Figure 18-1: Formatting Function

作者:semirock    时间:2009-07-01    来源:http://444p.com    点击:21876    本文共1篇文章 字体:[ ]

Figure 18-1: Formatting Function

<HTML>
<HEAD>
<TITLE>Figure 18-1</TITLE>
</HEAD>
<BODY>
<?
function PrintTitle($title)
{
print("<CENTER>");
print("<FONT COLOR=\"#0000FF\" SIZE=\"7\">");
print("<B>");
print(strtoupper($title));
print("</B>");
print("</FONT>");
print("</CENTER>\n");
}
?>


<HTML>
<HEAD>
<TITLE>Figure 18-1</TITLE>
</HEAD>

<BODY>
<? PrintTitle("Figure 18-1"); ?>
This is an example of using a function to repeat
a commonly-used piece of HTML code.<BR>
<BR>
<? PrintTitle("how it works"); ?>
Any time a title needs to be created, the <CODE>PrintTitle</CODE> www.444p.com版权所有
function is called with the text of the title.<BR>
<BR>
<? PrintTitle("advantages"); ?>
The code is more readable<BR>
Less text to type for each title<BR>
Easy to change every title<BR>

</BODY>
</HTML>
责任编辑:semirock
发表评论
密码: (游客不需要密码)
记住我【Alt+S 或 Ctrl+Enter 快速提交】

搜索工具


《PHP函数》点击排行