πŸ“Š PHP
Q. What will be the output?
Code:
$a = ['x'=>1, 'y'=>2];
echo json_encode($a);
  • (A) {"x":1,"y":2}
  • (B) [1,2]
  • (C) Error
  • (D) NULL
πŸ’¬ Discuss
βœ… Correct Answer: (A) {"x":1,"y":2}

Explanation: json_encode converts array to JSON object.

Explanation by: Roshan
json_encode converts array to JSON object.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
2
Total Visits
πŸ“½οΈ
8 d ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
97%
Success Rate