Q. What will be the output?
Code:
$a = ['x'=>1, 'y'=>2]; echo json_encode($a);
β
Correct Answer: (A)
{"x":1,"y":2}
Explanation: json_encode converts array to JSON object.