11.考虑如下代码片段:
复制PHP内容到剪贴板
PHP代码:
<?php
define("STOP_AT", 1024);
$result = array();
/* 在此处填入代码 */
{
$result[] = $idx;
}
print_r($result);
?>
标记处填入什么代码才能产生如下数组输出?
Array
{
[0] => 1
[1] => 2
[2] => 4
[3] => 8
[4] => 16
[5] => 32
[6] => 64
[7] => 128
[8] => 256
[9] => 512
}
A.foreach($result as $key => $val)
B.while($idx *= 2)
C.for($idx = 1; $idx < STOP_AT; $idx *= 2)
D.for($idx *= 2; STOP_AT >= $idx; $idx = 0)
E.while($idx < STOP_AT) do $idx *= 2

被折叠的 条评论
为什么被折叠?



