开发者

How do I write this foreach loop as any other kind of loop?

foreach ($a as $b)
{
do function开发者_如何学运维
}


while ($b.MoveNext())
{
    $a = $b.Current;
}


reset($a);
while (list($key, $value) = each($a)) { 
  //...
}

$keys = array_keys($a);
while (($key = array_shift($keys)) !== NULL))
{
  $b = $a[$key];
}


$i = 0;
while ($i < count($a))
{
  $b = $a[$i];

  //do function

  $i++;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜