Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$number = range(0, 5);
print_r ($number);
?>

A. Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 )

B. Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 )

C. Array ( [0] => 5 [1] => 5 [2] => 5 [3] => 5 [4] => 5 [5] => 5 )

D. Array ( [0] => 0 [5] => 5 )

Answer: Option A

Solution(By Examveda Team)

The range() function creates an array containing a range of elements.

This Question Belongs to PHP >> Arrays

Join The Discussion

Related Questions on Arrays