<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>
rand控制数据输出循环数量berak跳出
最新推荐文章于 2022-01-05 10:20:21 发布