Correcting teacher:查无此人
Correction status:qualified
Teacher's comments:完成的不错
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题</title> </head> <body> <form action="" method="get"> <p> <label for="email">邮箱:</label> <input type="email" id="email" name="email" placeholder="邮箱必须包含@" value=""> </p> <p> <label for="password">密码:</label> <input type="password" id="password" name="password" placeholder="不能少于6位" value=""> </p> <button>登录</button> </form> </body> </html> <?php print_r($_GET); ?>
点击 "运行实例" 按钮查看在线实例
<?php echo '<h2>1.判断</h2>'; $wages = 1000; var_dump($wages>1000 ? '买':'不买'); var_dump($wages>=1000 ? '买':'不买'); echo '<br/>'; $wages = 600; if ($wages>1000) { echo '买'; }elseif($wages>800){ echo '买一点'; }else{ echo '不买'; } echo '<br/>'; $wages = 1000; switch ($wages) { case $wages>1000: echo '买'; break; case $wages>800: echo '买一点'; break; default: echo '不买'; break; } echo '<br/>'; echo '<h2>2.循环</h2>'; $int = 1; while ( $int<= 10) { echo $int; echo '<hr/>'; $int++; } $int = 1; do { echo $int; echo '<hr>'; $int++; }while ( $int < 1); for($int=1; $int<=10; $int++){ echo $int; echo '<hr>'; } for( $int=1; $int<10; $int++){ echo $int; if($int == 6){ echo '比较特殊'; } echo '<hr>'; } echo '<h2>3.跳出流程</h2>'; for( $int=1; $int<10; $int++){ if($int == 6){ //结束当前循环,进入下次循环 continue; } echo $int; echo '<hr>'; } for( $int=1; $int<10; $int++){ if($int == 6){ //结束循环 break; } echo $int; echo '<hr>'; } ?>
点击 "运行实例" 按钮查看在线实例