[0] => 12

[1] => 14

)

, 3.

Array (

[0] => 2

[1]    => 4

[2]    => 6

[3]    => 8

[4]    => 10

)


, 4.

Array

[5]    =>12

)

Array

[5] => 14


, 5.

The code will throw a syntax error.

">
MCQs > IT & Programming > PHP 5 > 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); ?>

PHP 5 MCQs

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);

?>


Answer

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

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it