Q21
What will be the output of the following PHP code?
A.
Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5)
B.
Array([2]=>two [3]=>three [4]=>four)
C.
Array([1]=> 1)
D.
Array([0]=>0 [1]=>1 [5]=>5)
AnswerAnswer: Option D
Solution
Answer: Option D
Solution:
The preg_grep function is used to search an array for specific patterns and then return a new array based on that filtering.