这个脚本的输出是什么?

时间:2017-03-19 01:30:29

标签: php

在以下脚本中

<?php
$people = array("Joe", "Pete", "Mike", "Mark");
print_r (each($people));
?>

如果重申了第3行?

1 个答案:

答案 0 :(得分:0)

输入:

$people = array("Joe", "Pete", "Mike", "Mark");

print_r(each($people));
print_r(each($people));
print_r(each($people));
print_r(each($people));
var_dump(each($people));

输出:

Array
(
    [1] => Joe
    [value] => Joe
    [0] => 0
    [key] => 0
)
Array
(
    [1] => Pete
    [value] => Pete
    [0] => 1
    [key] => 1
)
Array
(
    [1] => Mike
    [value] => Mike
    [0] => 2
    [key] => 2
)
Array
(
    [1] => Mark
    [value] => Mark
    [0] => 3
    [key] => 3
)
bool(false)