Q. What will be the output?
Code:
$a = [1,2,3];
$b = array_map(function($v){ return $v*2; }, $a);
echo implode(',', $b);
β
Correct Answer: (B)
2,4,6
Explanation: array_map doubles each element.