[1] => 14
)
, 3.Array (
[0] => 2
[1] => 4
[2] => 6
[3] => 8
[4] => 10
)
Array
[5] =>12
)
Array
[5] => 14
The code will throw a syntax error.
In PHP 7.1, what will be the output of the following code?
$example = array(2, 4, 6, 8, 10);
foreach ($example as $x => $value){
unset($example[$x]);
}
print_r($example);
$example[] = 12;
print_r($example);
$example = array_values($example);
$example[] = 14;
print_r($example);
?>
Correct Answer:
Array
(
)
Array
( [5] => 12
)
Array
(
[0] => 12
[1] => 14
)
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More PHP 5 MCQ Questions