微信公众号 待发货-物流中-已收货 foreach break continue

w

<?php

$warr = array(1,2,3);
$w_break = 0;
foreach($warr AS $w){
    if($w==2)break;
    $w_break += $w;
}
echo $w_break;


$warr = array(1,2,3);
$w_continue = 0;
foreach($warr AS $w){
    if($w==2)continue;
    $w_continue += $w;
}
echo $w_continue;

 14

posted @ 2017-03-12 17:30  papering  阅读(167)  评论(0编辑  收藏  举报