语法格式:v">
时间:2021-07-01 10:21:17 帮助过:27人阅读
代码如下:
$arr = array (‘one', ‘two', ‘three', ‘four', ‘stop', ‘five');
while (list (, $val) = each ($arr)) {
if ($val == ‘stop') {
break;
}
echo "$val
\n";
}
$i = 0;
while (++$i) {
switch ($i) {
case 5:
echo "At 5
\n";
break 1;
case 10:
echo "At 10; quitting
\n";
break 2;
default:
break;
}
}
?>
代码如下:
while (list ($key, $value) = each ($arr)) {
if (!($key % 2)) { // skip odd members
continue;
}
do_something_odd ($value);
}
$i = 0;
while ($i++ < 5) {
echo "Outer
\n";
while (1) {
echo " Middle
\n";
while (1) {
echo " Inner
\n";
continue 3;
}
echo "This never gets output.
\n";
}
echo "Neither does this.
\n";
}
?>
以上就介绍了valkyrie destruction PHP中return 和 exit 、break和contiue 区别与用法,包括了valkyrie destruction方面的内容,希望对PHP教程有兴趣的朋友有所帮助。