phpcn_u69072
关注他

关注后可及时了解他的动态信息

课程笔记
  • 所属章节课程:php函数基本语法之自定义函数

    <?php function showtable($onecolor,$twocolor='yellow',$i=0,$j=0){ $str = ""; $str .= "<table aline='center' width='800' border='1'>"; for ($i;$i<10;$i++){ if ($i%2 == 0){ $str .= "<tr bgcolor=$onecolor>"; } else { $str .= "<tr bgcolor=$twocolor>"; } for ($j;$j<10;$j++){ $str .= "<td>"; $str .= "好 "; $str .= "</td>"; } $j = 0; $str .= "</tr>"; } $str .= "</table>"; echo $str; } echo showtable('blue'); ?>

    2017-12-220个赞

  • 所属章节课程:PHP流程控制之if语句

    <form mothod=get> <input type = "test" name ="num1"> <input type = "submit" name ="提交"> </form> <?php @header("content-Type: text/html; charset=utf-8"); @$num = $_GET["num1"]; if(is_null($num)){ print "请输入平年或闰年。"; exit; } if(preg_match('~[^0-9]+~i', $num)){ print "请输入正确的年份,如:2016。"; exit; } if(intval($num)%400 === 0 || (intval($num)%4 === 0 && intval($num)%100 != 0)) print "年份:" . intval($num) . "是闰年。"; else print "年份:" . intval($num) . "不是闰年。"; ?>

    2017-12-210个赞