¾µäÑ»·Àý×Ó
<HTML>
<HEAD>
<TITLE>¾µäÑ»·Àý×Ó</TITLE>
</HEAD>
<BODY>
<?
for($counter = 1; $counter <= 6; $counter++) //Ñ»·6´Î
{
print("<B>counter is $counter</B><BR>
"); //´òÓ¡6´Î
}
?>
</BODY>
</HTML>
forµÄ¸ß¼¶ÔËÓÃ
<HTML>
<HEAD>
<TITLE>forµÄ¸ß¼¶ÔËÓÃ</TITLE>
</HEAD>
<BODY>
<?
/*
** ´òÓ¡±ØÒªµÄ˵Ã÷ÎÄ×Ö
*/
print("<B>¾àÀëÐÇÆÚÒ»»¹Óм¸Ì죿</B>
");
print("<OL>
");
for($currentDate = date("U"); //¶¨Òå$currentDateʱ¼ä¸ñʽ
date("l", $currentDate) != "Monday"; //ÅжÏÊDz»Êǵ±Ç°ÏµÍ³Ê±¼äÊÇMonday
$currentDate += (60 * 60 * 24)) //µ±Ç°Ê±¼ä¼ÓÉÏ1Ìì
{
/*
** ´òӡʱ¼äÃû³Æ
*/
print("<LI>" . date("l", $currentDate) . "
");
}
print("</OL>
");
?>
</BODY>
</HTML>
º¯ÊýµÄ¼òµ¥µ÷ÓÃ:
<HTML>
<HEAD>
<TITLE>¼òµ¥µÄº¯Êý</TITLE>
</HEAD>
<BODY>
<FONT SIZE=5>
<?
function printBold($inputText) //¶¨Òåfunction printBold£¨£©
{
print("<B>" . $inputText . "</B>"); ////´òÓ¡$inputText
}
print("ÕâÐÐûÓмÓÖØ£¡<BR>
"); //Ö±½Ó´òÓ¡×Ö·û´®
printBold("ÕâÐмÓÖØÁË£¡£¡£¡"); //µ÷ÓÃfunction printBold()º¯Êý
print("<BR>
");
print("ÕâÐÐûÓмÓÖØ£¡<BR>
"); //Ö±½Ó´òÓ¡×Ö·û´®
?>
</FONT>
</BODY>
</HTML>
Óзµ»ØÖµµÄº¯Êý
<HTML>
<HEAD>
<TITLE>Óзµ»ØÖµµÄº¯Êý</TITLE>
</HEAD>
<BODY>
<FONT SIZE=5>
<?
function makeBold($inputText) //¶¨Òåfunction makeBold()º¯Êý
{
$boldedText = "<B>";
$boldedText .= $inputText;
$boldedText .= "</B>";
return($boldedText); //·µ»Ø±äÁ¿$boldedText