蓝盟诗人[LUC]蓝客联盟

忘记密码

孙仲岳一周学会PHP例程

2010-10-26 23:49 作者: 来源: 本站 浏览: 1,202 views 我要评论 字号:

=================

//while.php

<?
while($i<10)
{
echo $i . '<BR>';
$i++;
}
?>

==================

//swith.php

<?php

switch (date("D"))

{

case "Mon":

echo "今天星期一";

break;

case "Tue":

echo "今天星期二";

break;

case "Wed":

echo "今天星期三";

break;

case "Thu":

echo "今天星期四";

break;

case "Fri":

echo "今天星期五";

break;

default:

echo "今天休息";

break;

}

?>

=================================

//global.php

<?

$happy = 123;

myfun();

function myfun()

{

//global $happy;

echo $happy;

}

?>

==================================

//foreach.php

<?php

$myArray = Array( "1" => "SATURN", "2" => "SUN", "3" => "PHP");

foreach( $myArray AS $value )

{

echo $value . "<BR>";

}

foreach( $myArray AS $key =>$value )

{

echo "Key琌: $key; Value琌: $value<br>\n";

}

?>

========================================

//for.php

<?

for($i=0;$i<10;$i++)

{

echo $i . '<BR>';

}

?>

======================================

//do_while.php

<?

do

{

echo $i . '<BR>';

$i++;

}

while($i<10)

?>

===============================

//array.php

<?

$MyArray1 = array("琍", "び锭", "琍", "れ琍");

$MyArray2 = array("saturn" => "琍", "sun" => "び锭");

?>

====================================================

打印
分享到:
复制链接

发表评论

*

* (保密)

Ctrl+Enter 快捷回复

会员登录关闭

记住我 忘记密码

注册会员关闭

小提示: 您的密码会通过填写的"电子邮箱"发送给您.

/** **/