作者在 2010-12-12 02:41:25 发布以下内容
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>continue使用</title>
</head>
<body>
<?php
for($count=0;$count<=10;$count++){
if($count==5){
break;
}
echo $count.",";
}
echo "<br>";
for($count=0;$count<10;$count++){
echo $count;
if($count==10){
echo $count;
if($count==10){break;
}
echo",";
}
}
?>
</body>
</html>
代码写的不规范,希望大家见谅! 这个程序输出的是 1,2,3,4,5,6,7,8,9,10, 后面没逗号.就是用到了break语句结束掉.
其实我写这些基础 不是炫耀,老鸟过,新鸟与我一起探讨!我是为了以后方面,还有更好和大家交流这方面东西 !
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>continue使用</title>
</head>
<body>
<?php
for($count=0;$count<=10;$count++){
if($count==5){
break;
}
echo $count.",";
}
echo "<br>";
for($count=0;$count<10;$count++){
echo $count;
if($count==10){
echo $count;
if($count==10){break;
}
echo",";
}
}
?>
</body>
</html>
代码写的不规范,希望大家见谅! 这个程序输出的是 1,2,3,4,5,6,7,8,9,10, 后面没逗号.就是用到了break语句结束掉.
其实我写这些基础 不是炫耀,老鸟过,新鸟与我一起探讨!我是为了以后方面,还有更好和大家交流这方面东西 !

如图:
代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>continue使用</title>
</head>
<body>
<?php
for($count=0;$count<=10;$count++){
if($count==5){
continue;
}
echo $count.",";
}
?>
</body>
</html>
这个程序运行时候,条件是满足时结束,但用到if语句,他的条件是5,遇到这个语句continue;就是程序执行到时候跳过,从7开始继续执行
对数据库系统是很好优化!
如图:<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>continue使用</title>
</head>
<body>
<?php
for($count=0;$count<=10;$count++){
if($count==5){
continue;
}
echo $count.",";
}
?>
</body>
</html>
这个程序运行时候,条件是满足时结束,但用到if语句,他的条件是5,遇到这个语句continue;就是程序执行到时候跳过,从7开始继续执行
对数据库系统是很好优化!

看到吧 对于 break语句 我就不说 纯粹的结束语句 经常配合switch语句使用
大家看代码
