Vidyalelo
PHP · Q40

Arrays

Programming · PHP · question 40

Q40

What will be the output of the following PHP code?

A.
Array ( [0] => peach )
B.
Array ( [0] => apple [1] => mango [2] => peach )
C.
Array ( [0] => apple [1] => mango )
D.
Array ( [0] => peach [1] => pear [2] => orange )
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
The array_slice() function returns a section of an array based on a starting and ending offset value.