/*
$a=1;
if ($a=1){
	echo "一";
}else if ($a=2) {
	echo "二";
}else{
	echo "什么都不是";
}
*/

/*
$a=7;
switch ($a){
	case 6 : echo "六";
	break;
	case 7 : echo "七";
	break;
	case 8 : echo "八";
	break;
	default : echo "无";
}
*/
/*
$a=1;
while ($a<=100) {
	echo "
".$a; $a++; } */ /* for ($i = 0; $i <= 10; $i++) { echo "
".$i; } */ // break 跳出循环或条件后将结束该循环的操作 // continue 跳出循环或条件后将继续该循环的操作 /* $a=array("a","b","c","d"); echo $a[0]; */ /* function fun ($a, $b=0, $c=0) { $aa=$a+$b+$c; } $a=1; $b=2; $c=3; $d = fun($a,$b,$c); echo $d; */ //while循环 /* $i = 1 ; while ($i<=5){ echo $i; $i++; } */ //do while循环 /* $i=1; do { echo "a"; $i++; } while ($i<=3) */ /* for ($i = 1; $i <= 5; $i++) { for ($c = 1; $c <= $i; $c++) { echo "*"; } echo "
"; } */ //乘法口诀表 /* for ($j = 1; $j < 9; $j++) { for ($i = 1; $i <= $j; $i++) { $a=$i; echo $i ."X" .$j . "=" .$a*=$j; echo " "; } echo "
"; } */ //break contiune 用法 /* for ($i = 1; $i <= 5; $i++) { if ($i == 3) { continue; //break; } echo $i; } */ /* function fa($a, $b) { //return $a.$b; } */ //$a=array(array(1,2,3,4,5),array(6,7,8,9,0),8,7,7,6,8); //echo $a[1][2]; //print_r($a); ?>
Last modification:May 11th, 2019 at 11:39 pm
如果觉得我的文章对你有用,请随意赞赏