rand控制数据输出循环数量berak跳出

来源:互联网 发布:mac刷新dns缓存 编辑:程序博客网 时间:2024/05/01 08:39
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><?php//准备1-4.jpg图片类型再rand点输出 for ($a=0;$a<2;$a++){for($b=0;$b<2;$b++){for($c=0;$c<4;$c++){$rand = rand(1,4);echo "<img src='image/$rand.gif' >";}}}echo "<hr style='color:bule'>";//rand 4次 rand到4的数值图片都不输出 for($a=0;$a<4;$a++) {$rand = rand(1,4);if($rand!=4){echo "<img src='image/$rand.gif' >";}else{break;} }?></body>

0 0
原创粉丝点击